From d3745f0eda1cf6f97adae408a499e596ad6e8c92 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 30 May 2023 17:38:42 -0400 Subject: [PATCH 1/3] drop support for py37 (#474) (cherry picked from commit 85c1d199e8dd088b672e2157ae1f023c1a4b825c) --- .changes/unreleased/Breaking Changes-20230530-165542.yaml | 6 ++++++ .github/scripts/integration-test-matrix.js | 2 +- .github/workflows/main.yml | 4 ++-- CONTRIBUTING.MD | 2 +- setup.py | 7 +++---- tox.ini | 6 +++--- 6 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 .changes/unreleased/Breaking Changes-20230530-165542.yaml diff --git a/.changes/unreleased/Breaking Changes-20230530-165542.yaml b/.changes/unreleased/Breaking Changes-20230530-165542.yaml new file mode 100644 index 000000000..68b4bfdda --- /dev/null +++ b/.changes/unreleased/Breaking Changes-20230530-165542.yaml @@ -0,0 +1,6 @@ +kind: Breaking Changes +body: Drop support for python 3.7 +time: 2023-05-30T16:55:42.393416-04:00 +custom: + Author: mikealfare + Issue: dbt-core/7082 diff --git a/.github/scripts/integration-test-matrix.js b/.github/scripts/integration-test-matrix.js index df4d8fba7..d8696e944 100644 --- a/.github/scripts/integration-test-matrix.js +++ b/.github/scripts/integration-test-matrix.js @@ -1,6 +1,6 @@ module.exports = ({ context }) => { const defaultPythonVersion = "3.8"; - const supportedPythonVersions = ["3.7", "3.8"]; + const supportedPythonVersions = ["3.8"]; const supportedAdapters = ["redshift"]; // if PR, generate matrix based on files changed and PR labels diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cab72b59c..b2ce14afd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,7 +80,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8] # TODO: support unit testing for python 3.9 (https://github.com/dbt-labs/dbt/issues/3689) + python-version: [3.8] # TODO: support unit testing for python 3.9 (https://github.com/dbt-labs/dbt/issues/3689) env: TOXENV: "unit" @@ -178,7 +178,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.7', '3.8'] + python-version: ['3.8'] steps: - name: Set up Python ${{ matrix.python-version }} diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD index 87baedb8e..fed64fea0 100644 --- a/CONTRIBUTING.MD +++ b/CONTRIBUTING.MD @@ -70,7 +70,7 @@ $EDITOR test.env There are a few methods for running tests locally. #### `tox` -`tox` takes care of managing Python virtualenvs and installing dependencies in order to run tests. You can also run tests in parallel. For example, you can run unit tests for Python 3.7, Python 3.8, Python 3.10, and `flake8` checks in parallel with `tox -p`. Also, you can run unit tests for specific python versions with `tox -e py37`. The configuration of these tests are located in `tox.ini`. +`tox` takes care of managing Python virtualenvs and installing dependencies in order to run tests. You can also run tests in parallel. For example, you can run unit tests for Python 3.8, Python 3.10, and `flake8` checks in parallel with `tox -p`. Also, you can run unit tests for specific python versions with `tox -e py38`. The configuration of these tests are located in `tox.ini`. #### `pytest` Finally, you can also run a specific test or group of tests using `pytest` directly. With a Python virtualenv active and dev dependencies installed you can do things like: diff --git a/setup.py b/setup.py index 83b677084..56bd09065 100644 --- a/setup.py +++ b/setup.py @@ -4,9 +4,9 @@ import re # require python 3.7 or newer -if sys.version_info < (3, 7): +if sys.version_info < (3, 8): print('Error: dbt does not support this version of Python.') - print('Please upgrade to Python 3.7 or higher.') + print('Please upgrade to Python 3.8 or higher.') sys.exit(1) @@ -83,9 +83,8 @@ def _get_dbt_core_version(): 'Operating System :: MacOS :: MacOS X', 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', ], - python_requires=">=3.7", + python_requires=">=3.8", ) diff --git a/tox.ini b/tox.ini index 7ac9dac29..7de07d94c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = True -envlist = py37,py38,py39,flake8 +envlist = py38,py39,flake8 [testenv:flake8] description = flake8 code checks @@ -11,7 +11,7 @@ commands = flake8 --select=E,W,F --ignore=W504,E741 --max-line-length 99 \ deps = -rdev_requirements.txt -[testenv:{unit,py37,py38,py39,py}] +[testenv:{unit,py38,py39,py}] description = unit testing skip_install = true passenv = @@ -22,7 +22,7 @@ deps = -rdev_requirements.txt -e. -[testenv:{integration,py37,py38,py39,py}-{redshift}] +[testenv:{integration,py38,py39,py}-{redshift}] description = adapter plugin integration testing skip_install = true passenv = From e4aaec1a517551cfe23f3913d7d3fa2307e10ba3 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:32:06 -0400 Subject: [PATCH 2/3] Update CONTRIBUTING.MD Co-authored-by: leahwicz <60146280+leahwicz@users.noreply.github.com> --- CONTRIBUTING.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD index fed64fea0..423f54450 100644 --- a/CONTRIBUTING.MD +++ b/CONTRIBUTING.MD @@ -70,7 +70,7 @@ $EDITOR test.env There are a few methods for running tests locally. #### `tox` -`tox` takes care of managing Python virtualenvs and installing dependencies in order to run tests. You can also run tests in parallel. For example, you can run unit tests for Python 3.8, Python 3.10, and `flake8` checks in parallel with `tox -p`. Also, you can run unit tests for specific python versions with `tox -e py38`. The configuration of these tests are located in `tox.ini`. +`tox` takes care of managing Python virtualenvs and installing dependencies in order to run tests. You can also run tests in parallel. For example, you can run unit tests for Python 3.8 and `flake8` checks in parallel with `tox -p`. Also, you can run unit tests for specific python versions with `tox -e py38`. The configuration of these tests are located in `tox.ini`. #### `pytest` Finally, you can also run a specific test or group of tests using `pytest` directly. With a Python virtualenv active and dev dependencies installed you can do things like: From 33cd0c4a2db233cb0ac7b7506782fc709c631b29 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:32:17 -0400 Subject: [PATCH 3/3] Update setup.py Co-authored-by: leahwicz <60146280+leahwicz@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 56bd09065..29a66178e 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import sys import re -# require python 3.7 or newer +# require python 3.8 or newer if sys.version_info < (3, 8): print('Error: dbt does not support this version of Python.') print('Please upgrade to Python 3.8 or higher.')