From c971472c83e263e9e510db74e56deece3b0b7546 Mon Sep 17 00:00:00 2001 From: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:45:21 -0700 Subject: [PATCH] drop support for py37 (#474) (#502) * drop support for py37 * drop support for py37 (cherry picked from commit 85c1d199e8dd088b672e2157ae1f023c1a4b825c) Co-authored-by: Mike Alfare <13974384+mikealfare@users.noreply.github.com> --- .../Breaking Changes-20230530-165542.yaml | 6 ++++++ .github/scripts/integration-test-matrix.js | 2 +- .github/workflows/main.yml | 4 ++-- CONTRIBUTING.md | 2 +- dev-requirements.txt | 21 ++++++++----------- setup.py | 7 +++---- tox.ini | 6 +++--- 7 files changed, 25 insertions(+), 23 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 9e7698ef5..7db445d9e 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", "3.9", "3.10", "3.11"]; + const supportedPythonVersions = ["3.8", "3.9", "3.10", "3.11"]; 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 9137fe91d..6b01effb9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,7 +72,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] env: TOXENV: "unit" @@ -175,7 +175,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - name: Set up Python ${{ matrix.python-version }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e4bc28f0..ff08b6190 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.9, 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.9, 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/dev-requirements.txt b/dev-requirements.txt index a9dca8aeb..6c6c0db61 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -6,28 +6,25 @@ git+https://github.com/dbt-labs/dbt-core.git@1.5.latest#egg=dbt-postgres&subdire # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor -black~=23.1 +black~=23.3 bumpversion~=0.6.0 click~=8.1 -flake8~=5.0;python_version=="3.7" -flake8~=6.0;python_version>="3.8" +flake8~=6.0 flaky~=3.7 freezegun~=1.2 ipdb~=0.13.13 -mypy==1.1.1 # patch updates have historically introduced breaking changes -pip-tools~=6.12 -pre-commit~=2.21;python_version=="3.7" -pre-commit~=3.2;python_version>="3.8" +mypy==1.2.0 # patch updates have historically introduced breaking changes +pip-tools~=6.13 +pre-commit~=3.2 pre-commit-hooks~=4.4 -pytest~=7.2 +pytest~=7.3 pytest-csv~=3.0 pytest-dotenv~=0.5.2 pytest-logbook~=1.2 pytest-xdist~=3.2 -pytz~=2023.2 -tox~=3.0;python_version=="3.7" -tox~=4.4;python_version>="3.8" -types-pytz~=2023.2 +pytz~=2023.3 +tox~=4.5 +types-pytz~=2023.3 types-requests~=2.28 twine~=4.0 wheel~=0.40 diff --git a/setup.py b/setup.py index a361f9997..b5c6f9189 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,9 @@ #!/usr/bin/env python import sys -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) @@ -94,11 +94,10 @@ def _core_version(plugin_version: str = _plugin_version()) -> str: "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ], - python_requires=">=3.7", + python_requires=">=3.8", ) diff --git a/tox.ini b/tox.ini index 81625647a..b42bd89b7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] skipsdist = True -envlist = py37,py38,py39,py310,py311 +envlist = py38,py39,py310,py311 -[testenv:{unit,py37,py38,py39,py310,py311,py}] +[testenv:{unit,py38,py39,py310,py311,py}] description = unit testing skip_install = true passenv = @@ -13,7 +13,7 @@ deps = -rdev-requirements.txt -e. -[testenv:{integration,py37,py38,py39,py310,py311,py}-{redshift}] +[testenv:{integration,py38,py39,py310,py311,py}-{redshift}] description = adapter plugin integration testing skip_install = true passenv =