-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix for 2347 #2722
fix for 2347 #2722
Conversation
**Introduction** This PR attempts to fix #2347, wherein we wish `dbt` to complain about trying to install with a Python version < 3.6. **Changes** Per [the issue's suggestion](#2347), I found every `setup.py` file I could: ``` -# If you have the fantastic `fd` utility installed: fd setup.py -# This also works find . -name setup.py -print ``` Then to each of these, I added the following after the `import sys`: ``` 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.') sys.exit(1) ``` **Testing** I used the [`nix` package manager](https://nixos.org) to attempt installing this branch with both Python 2.7 and Python 3.8. _Python 2.7_ fails as expected: ``` ~/github/test2 ∃ cat default.nix let pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/20.03.tar.gz") { }; py = pkgs.python27Full.withPackages (p: [ p.setuptools ]); in pkgs.mkShell { name = "python-2-env"; buildInputs = [ py ]; } ~/github/test2 ∃ nix-shell --pure [nix-shell:~/github/test2]$ python ../dbt/setup.py build Error: dbt does not support this version of Python. Please upgrade to Python 3.6 or higher. [nix-shell:~/github/test2]$ echo $? 1 ``` _Python 3.8_ still works: ``` ~/github/test3 ∃ cat default.nix let pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/20.03.tar.gz") { }; py = pkgs.python38Full.withPackages (p: [ p.setuptools ]); in pkgs.mkShell { name = "python-3-env"; buildInputs = [ py ]; } ~/github/test3 ∃ nix-shell --pure [nix-shell:~/github/test3]$ python ../dbt/setup.py build running build [nix-shell:~/github/test3]$ echo $? 0 ```
The latest commit (707310d) is to fix a merge conflict only in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm! Thanks so much for the contribution, @genos :) I think we can sneak this in for v0.18.0.
@@ -3,6 +3,7 @@ | |||
|
|||
### Under the hood | |||
- Added 3 more adapter methods that the new dbt-adapter-test suite can use for testing. ([#2492](https://github.com/fishtown-analytics/dbt/issues/2492), [#2721](https://github.com/fishtown-analytics/dbt/pull/2721)) | |||
- It is now an error to attempt installing `dbt` with a Python version less than 3.6. (resolves [#2347](https://github.com/fishtown-analytics/dbt/issues/2347)) | |||
- Check for Postgres relation names longer than 63 and throw exception. ([#2197](https://github.com/fishtown-analytics/dbt/issues/2197)) | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a Contributors section (similar to the ones below) and include your GitHub handle + a link to this PR? We want to give you credit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly! See 81bf3da
resolves #2347
Description
Introduction
This PR attempts to fix #2347, wherein we wish
dbt
to complain about trying to install with a Python version < 3.6.Changes
Per the issue's suggestion, I found every
setup.py
file I could:Then to each of these, I added the following after the
import sys
:Testing
I used the
nix
package manager to attempt building this branch with both Python 2.7 and Python 3.8.Python 2.7
Fails as expected:
Python 3.8
Builds just fine
Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.