-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**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 ```
- Loading branch information
genos
committed
Aug 23, 2020
1 parent
fe46138
commit 59bf43d
Showing
6 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters