Skip to content

Commit

Permalink
Merge pull request #35 from mikekaminsky/fix/change-dbt-requirement-h…
Browse files Browse the repository at this point in the history
…andling

Fix: change dbt requirement handling
  • Loading branch information
aescay authored Aug 5, 2020
2 parents c3e106e + d83830a commit 921bcd6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import core.retry_failed as retry_failed_task

from dbt.config import PROFILES_DIR
from dbt.version import get_installed_version


def get_nearest_project_dir():
Expand All @@ -25,6 +26,24 @@ def get_nearest_project_dir():
return None


def test_dbt_version():
# Test if the dbt version is compatible with this version of dbt-helper
installed_version = get_installed_version()

VERSION_INCOMPATIBILITY_MSG = """
Installed dbt version: {}
dbt-helper requires dbt version 0.17.X or higher.
You can find upgrade instructions here:
https://docs.getdbt.com/docs/installation
""".format(
installed_version.to_version_string(skip_matcher=True)
)

if int(get_installed_version().minor) < 17:
print(VERSION_INCOMPATIBILITY_MSG)
sys.exit(1)


def parse_args(args):

p = argparse.ArgumentParser(
Expand Down Expand Up @@ -237,4 +256,6 @@ def main(args=None):
if args is None:
args = sys.argv[1:]

test_dbt_version()

handle(args)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


package_name = "dbt-helper"
VERSION = "0.4.0"
VERSION = "0.4.1"
description = """dbt-helper is a command line tool to help ease dbt development and database management"""


Expand Down Expand Up @@ -39,6 +39,6 @@ def run(self):
test_suite="test",
entry_points={"console_scripts": ["dbt-helper = core.main:main"]},
scripts=[],
install_requires=["dbt>=0.17.1"],
install_requires=["dbt"],
cmdclass={"verify": VerifyVersionCommand},
)

0 comments on commit 921bcd6

Please sign in to comment.