From 73cfc65feea4ea64228324b5e9a5a41d43693b82 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Tue, 26 Oct 2021 11:08:16 +0200 Subject: [PATCH 01/11] Raise error on pip install dbt --- core/setup.py | 12 +++++++----- setup.py | 15 ++++++++++----- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/core/setup.py b/core/setup.py index 12e0081b559..ac3f8de4ca5 100644 --- a/core/setup.py +++ b/core/setup.py @@ -19,21 +19,23 @@ sys.exit(1) -def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() +# use README from repository root +this_directory = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +with open(os.path.join(this_directory, 'README.md')) as f: + long_description = f.read() package_name = "dbt-core" package_version = "1.0.0b2" -description = """dbt (data build tool) is a command line tool that helps \ -analysts and engineers transform data in their warehouse more effectively""" +description = """With dbt, data analysts and engineers can build analytics \ +the way engineers build applications.""" setup( name=package_name, version=package_version, description=description, - long_description=description, + long_description=long_description, author="dbt Labs", author_email="info@dbtlabs.com", url="https://github.com/dbt-labs/dbt-core", diff --git a/setup.py b/setup.py index ad08e77e196..11a3fce3628 100644 --- a/setup.py +++ b/setup.py @@ -40,11 +40,6 @@ author="dbt Labs", author_email="info@dbtlabs.com", url="https://github.com/dbt-labs/dbt-core", - packages=[], - install_requires=[ - 'dbt-core=={}'.format(package_version), - 'dbt-postgres=={}'.format(package_version), - ], zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -62,3 +57,13 @@ ], python_requires=">=3.6.2", ) + + +print('') +print('As of v1.0.0, `pip install dbt` is no longer supported.') +print('Instead, please use either:') +print(' - `pip install dbt-core`, for core functionality') +print(' - `pip install dbt-`, to use dbt with your database, platform, or query engine') +print('See full list: https://docs.getdbt.com/docs/available-adapters') +print('') +sys.exit(1) From 56e2ab392cbaaae7dc138f75f08b533ebf162738 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Tue, 26 Oct 2021 15:28:59 +0200 Subject: [PATCH 02/11] Fix relative path logic --- core/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/setup.py b/core/setup.py index ac3f8de4ca5..48e0ff549c9 100644 --- a/core/setup.py +++ b/core/setup.py @@ -20,8 +20,8 @@ # use README from repository root -this_directory = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) -with open(os.path.join(this_directory, 'README.md')) as f: +root_directory = os.path.abspath(os.path.join(os.path.dirname(__file__),'..')) +with open(os.path.join(root_directory, 'README.md')) as f: long_description = f.read() From b1bff41071b9dba88226b0173df71c2197fd6b9a Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Wed, 3 Nov 2021 10:33:14 +0100 Subject: [PATCH 03/11] Do not build dist for dbt --- scripts/build-dist.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/build-dist.sh b/scripts/build-dist.sh index 5f04ef451ee..f0515d4bc29 100755 --- a/scripts/build-dist.sh +++ b/scripts/build-dist.sh @@ -23,7 +23,4 @@ do cp -r "$DBT_PATH"/"$SUBPATH"/dist/* "$DBT_PATH"/dist/ done -cd "$DBT_PATH" -$PYTHON_BIN setup.py sdist bdist_wheel - set +x From 3268d40ad8b748ad22e9d393cdd4385659e0d9ff Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Wed, 3 Nov 2021 10:43:01 +0100 Subject: [PATCH 04/11] Fix long descriptions --- core/setup.py | 1 + plugins/postgres/setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/setup.py b/core/setup.py index 48e0ff549c9..c912da6eae4 100644 --- a/core/setup.py +++ b/core/setup.py @@ -36,6 +36,7 @@ version=package_version, description=description, long_description=long_description, + long_description_content_type='text/markdown', author="dbt Labs", author_email="info@dbtlabs.com", url="https://github.com/dbt-labs/dbt-core", diff --git a/plugins/postgres/setup.py b/plugins/postgres/setup.py index 8fab6dd014f..f66192c298f 100644 --- a/plugins/postgres/setup.py +++ b/plugins/postgres/setup.py @@ -54,7 +54,7 @@ def _dbt_psycopg2_name(): name=package_name, version=package_version, description=description, - long_description=description, + long_description=long_description, long_description_content_type='text/markdown', author="dbt Labs", author_email="info@dbtlabs.com", From 2f26d04281e5259b8f8f1a348fe84f1a5c60917c Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Wed, 3 Nov 2021 10:47:26 +0100 Subject: [PATCH 05/11] Trigger code checks From 8f109f96e00068a9e0a4bb487da7639606d6747d Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Wed, 3 Nov 2021 10:53:35 +0100 Subject: [PATCH 06/11] Using root readme more trouble than good --- core/README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ core/setup.py | 5 ++--- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 core/README.md diff --git a/core/README.md b/core/README.md new file mode 100644 index 00000000000..38bc670c802 --- /dev/null +++ b/core/README.md @@ -0,0 +1,42 @@ +

+ dbt logo +

+

+ + Unit Tests Badge + + + Integration Tests Badge + +

+ +**[dbt](https://www.getdbt.com/)** enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications. + +![architecture](https://raw.githubusercontent.com/dbt-labs/dbt-core/6c6649f9129d5d108aa3b0526f634cd8f3a9d1ed/etc/dbt-arch.png) + +## Understanding dbt + +Analysts using dbt can transform their data by simply writing select statements, while dbt handles turning these statements into tables and views in a data warehouse. + +These select statements, or "models", form a dbt project. Models frequently build on top of one another – dbt makes it easy to [manage relationships](https://docs.getdbt.com/docs/ref) between models, and [visualize these relationships](https://docs.getdbt.com/docs/documentation), as well as assure the quality of your transformations through [testing](https://docs.getdbt.com/docs/testing). + +![dbt dag](https://raw.githubusercontent.com/dbt-labs/dbt-core/6c6649f9129d5d108aa3b0526f634cd8f3a9d1ed/etc/dbt-dag.png) + +## Getting started + +- [Install dbt](https://docs.getdbt.com/docs/installation) +- Read the [introduction](https://docs.getdbt.com/docs/introduction/) and [viewpoint](https://docs.getdbt.com/docs/about/viewpoint/) + +## Join the dbt Community + +- Be part of the conversation in the [dbt Community Slack](http://community.getdbt.com/) +- Read more on the [dbt Community Discourse](https://discourse.getdbt.com) + +## Reporting bugs and contributing code + +- Want to report a bug or request a feature? Let us know on [Slack](http://community.getdbt.com/), or open [an issue](https://github.com/dbt-labs/dbt-core/issues/new) +- Want to help us build dbt? Check out the [Contributing Guide](https://github.com/dbt-labs/dbt-core/blob/HEAD/CONTRIBUTING.md) + +## Code of Conduct + +Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [dbt Code of Conduct](https://community.getdbt.com/code-of-conduct). diff --git a/core/setup.py b/core/setup.py index c912da6eae4..13951cd6ae4 100644 --- a/core/setup.py +++ b/core/setup.py @@ -19,9 +19,8 @@ sys.exit(1) -# use README from repository root -root_directory = os.path.abspath(os.path.join(os.path.dirname(__file__),'..')) -with open(os.path.join(root_directory, 'README.md')) as f: +this_directory = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(this_directory, 'README.md')) as f: long_description = f.read() From c0ae0cbec0428c36520b91d76f73307ef2b5fc16 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Fri, 5 Nov 2021 09:57:38 -0400 Subject: [PATCH 07/11] only fail on install, not build --- setup.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 11a3fce3628..af5124310bd 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ url="https://github.com/dbt-labs/dbt-core", zip_safe=False, classifiers=[ - 'Development Status :: 5 - Production/Stable', + 'Development Status :: 7 - Inactive', 'License :: OSI Approved :: Apache Software License', @@ -59,11 +59,12 @@ ) -print('') -print('As of v1.0.0, `pip install dbt` is no longer supported.') -print('Instead, please use either:') -print(' - `pip install dbt-core`, for core functionality') -print(' - `pip install dbt-`, to use dbt with your database, platform, or query engine') -print('See full list: https://docs.getdbt.com/docs/available-adapters') -print('') -sys.exit(1) +if 'sdist' not in sys.argv: + print('') + print('As of v1.0.0, `pip install dbt` is no longer supported.') + print('Instead, please use either:') + print(' - `pip install dbt-core`, for core functionality') + print(' - `pip install dbt-`, to use dbt with your database, platform, or query engine') + print('See full list: https://docs.getdbt.com/docs/available-adapters') + print('') + sys.exit(1) From 49fae7287e8e76d807511202fb2563eb870e22a5 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Fri, 5 Nov 2021 16:35:19 +0100 Subject: [PATCH 08/11] Edit dist script. Avoid README duplication --- core/README.md | 42 ------------------------------------------ scripts/build-dist.sh | 9 +++++++++ setup.py | 23 ++++++++++++----------- 3 files changed, 21 insertions(+), 53 deletions(-) delete mode 100644 core/README.md diff --git a/core/README.md b/core/README.md deleted file mode 100644 index 38bc670c802..00000000000 --- a/core/README.md +++ /dev/null @@ -1,42 +0,0 @@ -

- dbt logo -

-

- - Unit Tests Badge - - - Integration Tests Badge - -

- -**[dbt](https://www.getdbt.com/)** enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications. - -![architecture](https://raw.githubusercontent.com/dbt-labs/dbt-core/6c6649f9129d5d108aa3b0526f634cd8f3a9d1ed/etc/dbt-arch.png) - -## Understanding dbt - -Analysts using dbt can transform their data by simply writing select statements, while dbt handles turning these statements into tables and views in a data warehouse. - -These select statements, or "models", form a dbt project. Models frequently build on top of one another – dbt makes it easy to [manage relationships](https://docs.getdbt.com/docs/ref) between models, and [visualize these relationships](https://docs.getdbt.com/docs/documentation), as well as assure the quality of your transformations through [testing](https://docs.getdbt.com/docs/testing). - -![dbt dag](https://raw.githubusercontent.com/dbt-labs/dbt-core/6c6649f9129d5d108aa3b0526f634cd8f3a9d1ed/etc/dbt-dag.png) - -## Getting started - -- [Install dbt](https://docs.getdbt.com/docs/installation) -- Read the [introduction](https://docs.getdbt.com/docs/introduction/) and [viewpoint](https://docs.getdbt.com/docs/about/viewpoint/) - -## Join the dbt Community - -- Be part of the conversation in the [dbt Community Slack](http://community.getdbt.com/) -- Read more on the [dbt Community Discourse](https://discourse.getdbt.com) - -## Reporting bugs and contributing code - -- Want to report a bug or request a feature? Let us know on [Slack](http://community.getdbt.com/), or open [an issue](https://github.com/dbt-labs/dbt-core/issues/new) -- Want to help us build dbt? Check out the [Contributing Guide](https://github.com/dbt-labs/dbt-core/blob/HEAD/CONTRIBUTING.md) - -## Code of Conduct - -Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [dbt Code of Conduct](https://community.getdbt.com/code-of-conduct). diff --git a/scripts/build-dist.sh b/scripts/build-dist.sh index f0515d4bc29..414df1991b5 100755 --- a/scripts/build-dist.sh +++ b/scripts/build-dist.sh @@ -18,9 +18,18 @@ for SUBPATH in core plugins/postgres do rm -rf "$DBT_PATH"/"$SUBPATH"/dist rm -rf "$DBT_PATH"/"$SUBPATH"/build + if [[ $SUBPATH == "core" ]] + then cp "$DBT_PATH"/README.md "$DBT_PATH"/"$SUBPATH"/ + fi cd "$DBT_PATH"/"$SUBPATH" $PYTHON_BIN setup.py sdist bdist_wheel cp -r "$DBT_PATH"/"$SUBPATH"/dist/* "$DBT_PATH"/dist/ + if [[ $SUBPATH == "core" ]] + then rm "$DBT_PATH"/"$SUBPATH"/README.md + fi done +cd "$DBT_PATH" +$PYTHON_BIN setup.py sdist + set +x diff --git a/setup.py b/setup.py index af5124310bd..3b11a38463f 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,18 @@ import os import sys + +if 'sdist' not in sys.argv: + print('') + print('As of v1.0.0, `pip install dbt` is no longer supported.') + print('Instead, please use either:') + print(' - `pip install dbt-core`, for core functionality') + print(' - `pip install dbt-`, to use dbt with your database, platform, or query engine') + print('See full list: https://docs.getdbt.com/docs/available-adapters') + print('') + sys.exit(1) + + if sys.version_info < (3, 6): print('Error: dbt does not support this version of Python.') print('Please upgrade to Python 3.6 or higher.') @@ -57,14 +69,3 @@ ], python_requires=">=3.6.2", ) - - -if 'sdist' not in sys.argv: - print('') - print('As of v1.0.0, `pip install dbt` is no longer supported.') - print('Instead, please use either:') - print(' - `pip install dbt-core`, for core functionality') - print(' - `pip install dbt-`, to use dbt with your database, platform, or query engine') - print('See full list: https://docs.getdbt.com/docs/available-adapters') - print('') - sys.exit(1) From cfcdbeed00fc44c5ca8c68742ecd9308afaa0937 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Fri, 5 Nov 2021 16:40:04 +0100 Subject: [PATCH 09/11] jk, be less clever --- core/README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ scripts/build-dist.sh | 6 ------ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 core/README.md diff --git a/core/README.md b/core/README.md new file mode 100644 index 00000000000..38bc670c802 --- /dev/null +++ b/core/README.md @@ -0,0 +1,42 @@ +

+ dbt logo +

+

+ + Unit Tests Badge + + + Integration Tests Badge + +

+ +**[dbt](https://www.getdbt.com/)** enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications. + +![architecture](https://raw.githubusercontent.com/dbt-labs/dbt-core/6c6649f9129d5d108aa3b0526f634cd8f3a9d1ed/etc/dbt-arch.png) + +## Understanding dbt + +Analysts using dbt can transform their data by simply writing select statements, while dbt handles turning these statements into tables and views in a data warehouse. + +These select statements, or "models", form a dbt project. Models frequently build on top of one another – dbt makes it easy to [manage relationships](https://docs.getdbt.com/docs/ref) between models, and [visualize these relationships](https://docs.getdbt.com/docs/documentation), as well as assure the quality of your transformations through [testing](https://docs.getdbt.com/docs/testing). + +![dbt dag](https://raw.githubusercontent.com/dbt-labs/dbt-core/6c6649f9129d5d108aa3b0526f634cd8f3a9d1ed/etc/dbt-dag.png) + +## Getting started + +- [Install dbt](https://docs.getdbt.com/docs/installation) +- Read the [introduction](https://docs.getdbt.com/docs/introduction/) and [viewpoint](https://docs.getdbt.com/docs/about/viewpoint/) + +## Join the dbt Community + +- Be part of the conversation in the [dbt Community Slack](http://community.getdbt.com/) +- Read more on the [dbt Community Discourse](https://discourse.getdbt.com) + +## Reporting bugs and contributing code + +- Want to report a bug or request a feature? Let us know on [Slack](http://community.getdbt.com/), or open [an issue](https://github.com/dbt-labs/dbt-core/issues/new) +- Want to help us build dbt? Check out the [Contributing Guide](https://github.com/dbt-labs/dbt-core/blob/HEAD/CONTRIBUTING.md) + +## Code of Conduct + +Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [dbt Code of Conduct](https://community.getdbt.com/code-of-conduct). diff --git a/scripts/build-dist.sh b/scripts/build-dist.sh index 414df1991b5..86f4437b8e3 100755 --- a/scripts/build-dist.sh +++ b/scripts/build-dist.sh @@ -18,15 +18,9 @@ for SUBPATH in core plugins/postgres do rm -rf "$DBT_PATH"/"$SUBPATH"/dist rm -rf "$DBT_PATH"/"$SUBPATH"/build - if [[ $SUBPATH == "core" ]] - then cp "$DBT_PATH"/README.md "$DBT_PATH"/"$SUBPATH"/ - fi cd "$DBT_PATH"/"$SUBPATH" $PYTHON_BIN setup.py sdist bdist_wheel cp -r "$DBT_PATH"/"$SUBPATH"/dist/* "$DBT_PATH"/dist/ - if [[ $SUBPATH == "core" ]] - then rm "$DBT_PATH"/"$SUBPATH"/README.md - fi done cd "$DBT_PATH" From 393f991b99c1f4ab5e4c34c31135fc1005fb3607 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Sun, 7 Nov 2021 17:28:35 +0100 Subject: [PATCH 10/11] Ignore 'dbt' source distribution when testing --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bc71f673f4f..3246dbfa335 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -198,8 +198,9 @@ jobs: dbt --version - name: Install source distributions + # ignore dbt-1.0.0, which intentionally raises an error when installed from source run: | - find ./dist/*.gz -maxdepth 1 -type f | xargs pip install --force-reinstall --find-links=dist/ + find ./dist/dbt-[a-z]*.gz -maxdepth 1 -type f | xargs pip install --force-reinstall --find-links=dist/ - name: Check source distributions run: | From 7ee2f18a5222eb2375e56c83d9f1b3be9c664b59 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Sun, 7 Nov 2021 17:47:28 +0100 Subject: [PATCH 11/11] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e7e1ef1182..3ec3d852afa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Breaking changes - Replace `greedy` flag/property for test selection with `indirect_selection: eager/cautious` flag/property. Set to `eager` by default. **Note:** This reverts test selection to its pre-v0.20 behavior by default. `dbt test -s my_model` _will_ select multi-parent tests, such as `relationships`, that depend on unselected resources. To achieve the behavior change in v0.20 + v0.21, set `--indirect-selection=cautious` on the CLI or `indirect_selection: cautious` in yaml selectors. ([#4082](https://github.com/dbt-labs/dbt-core/issues/4082), [#4104](https://github.com/dbt-labs/dbt-core/pull/4104)) +- In v1.0.0, **`pip install dbt` will raise an explicit error.** Instead, please use `pip install dbt-` (to use dbt with that database adapter), or `pip install dbt-core` (for core functionality). For parity with the previous behavior of `pip install dbt`, you can use: `pip install dbt-core dbt-postgres dbt-redshift dbt-snowflake dbt-bigquery` ([#4100](https://github.com/dbt-labs/dbt-core/issues/4100), [#4133](https://github.com/dbt-labs/dbt-core/pull/4133)) ### Features - Allow nullable `error_after` in source freshness ([#3874](https://github.com/dbt-labs/dbt-core/issues/3874), [#3955](https://github.com/dbt-labs/dbt-core/pull/3955))