From a2c4b8c45cb93995c5ec598e37bc976e20232aba Mon Sep 17 00:00:00 2001 From: aescay Date: Tue, 4 Aug 2020 23:33:32 -0400 Subject: [PATCH 1/5] test dbt version before handling arguments --- core/main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/main.py b/core/main.py index 5ed7be9..0c3b406 100644 --- a/core/main.py +++ b/core/main.py @@ -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(): @@ -24,6 +25,20 @@ 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): @@ -234,4 +249,6 @@ def main(args=None): if args is None: args = sys.argv[1:] + test_dbt_version() + handle(args) From 2af6ddd9c42b8f42e385166ad1de284364dd54fa Mon Sep 17 00:00:00 2001 From: aescay Date: Tue, 4 Aug 2020 23:48:17 -0400 Subject: [PATCH 2/5] drop required version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index acc391f..ab97119 100644 --- a/setup.py +++ b/setup.py @@ -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}, ) From 0ee75be735fa97db8b5eb819de6c3b837372bbb9 Mon Sep 17 00:00:00 2001 From: aescay Date: Tue, 4 Aug 2020 23:58:56 -0400 Subject: [PATCH 3/5] format with black --- core/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/main.py b/core/main.py index e68459c..5a35b13 100644 --- a/core/main.py +++ b/core/main.py @@ -25,6 +25,7 @@ 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() @@ -34,12 +35,15 @@ def test_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)) + """.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( From 870afde2f772ffb516a4fa906a081b194f110b5a Mon Sep 17 00:00:00 2001 From: aescay Date: Wed, 5 Aug 2020 00:07:22 -0400 Subject: [PATCH 4/5] remove trailing whitespace --- core/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/main.py b/core/main.py index 5a35b13..77e5f0d 100644 --- a/core/main.py +++ b/core/main.py @@ -33,7 +33,7 @@ def test_dbt_version(): VERSION_INCOMPATIBILITY_MSG = """ Installed dbt version: {} dbt-helper requires dbt version 0.17.X or higher. - You can find upgrade instructions here: + You can find upgrade instructions here: https://docs.getdbt.com/docs/installation """.format( installed_version.to_version_string(skip_matcher=True) From d83830a2fd8495eff1d3337486ae6956a4e3677f Mon Sep 17 00:00:00 2001 From: aescay Date: Wed, 5 Aug 2020 00:08:30 -0400 Subject: [PATCH 5/5] bump version to 0.4.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ab97119..042c3bd 100644 --- a/setup.py +++ b/setup.py @@ -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"""