Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail more gracefully when setuptools is downlevel (#1975) #1978

Merged
merged 2 commits into from
Dec 5, 2019

Conversation

beckjake
Copy link
Contributor

@beckjake beckjake commented Dec 4, 2019

Fixes #1975

When we can't import find_namespace_packages, print a message and exit with a non-zero code.

Before:

$ pip install -r requirements.txt
Processing ./core
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/31/mrzqbbtd3rn4hmgbhrtkfyxm0000gn/T/pip-wc7b1oy9-build/setup.py", line 2, in <module>
        from setuptools import find_namespace_packages
    ImportError: cannot import name 'find_namespace_packages'

Now:

$ pip install -r requirements.txt
Processing ./core
    Complete output from command python setup.py egg_info:
    Error: dbt requires setuptools v40.1.0 or higher.
    Please upgrade setuptools with "pip install --upgrade setuptools" and try again

@cla-bot cla-bot bot added the cla:yes label Dec 4, 2019
@beckjake beckjake force-pushed the feature/detect-downlevel-setuptools branch from 714e4af to a771c63 Compare December 4, 2019 21:46
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor copy comments here, nothing major. One quick question: is there any merit to stating a requirement on the version of setuptools? Or is that not appropriate here?

core/setup.py Outdated Show resolved Hide resolved
plugins/bigquery/setup.py Outdated Show resolved Hide resolved
plugins/postgres/setup.py Outdated Show resolved Hide resolved
plugins/redshift/setup.py Outdated Show resolved Hide resolved
plugins/snowflake/setup.py Outdated Show resolved Hide resolved
@beckjake
Copy link
Contributor Author

beckjake commented Dec 5, 2019

Unfortunately, this error happens before pip gets to do things like process install_requires, so I don't see how it will help.

@drewbanin
Copy link
Contributor

^ that makes perfect sense, thanks for clarifying!

@beckjake beckjake merged commit a993d9c into dev/0.15.1 Dec 5, 2019
@beckjake beckjake deleted the feature/detect-downlevel-setuptools branch December 5, 2019 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

detect when setuptools is downlevel and abort the isntall with a good error
2 participants