From 1ecd8e902d0451c3a0c0db8393eeeef13f933516 Mon Sep 17 00:00:00 2001 From: Matthew McKnight <91097623+McKnight-42@users.noreply.github.com> Date: Tue, 30 May 2023 16:47:13 -0500 Subject: [PATCH] drop support for python 3.7 (#793) * drop support for python 3.7 * add changelog entry * missed change --- .changes/unreleased/Under the Hood-20230530-162533.yaml | 6 ++++++ .github/workflows/main.yml | 4 ++-- CONTRIBUTING.md | 2 +- dev-requirements.txt | 3 --- setup.py | 9 ++++----- tox.ini | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 .changes/unreleased/Under the Hood-20230530-162533.yaml diff --git a/.changes/unreleased/Under the Hood-20230530-162533.yaml b/.changes/unreleased/Under the Hood-20230530-162533.yaml new file mode 100644 index 000000000..857db085f --- /dev/null +++ b/.changes/unreleased/Under the Hood-20230530-162533.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: drop support for python 3.7 +time: 2023-05-30T16:25:33.109326-05:00 +custom: + Author: McKnight-42 + Issue: "792" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f24aa74fa..6b3d93b6e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] env: TOXENV: "unit" @@ -177,7 +177,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - name: Set up Python ${{ matrix.python-version }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 57d6ee474..a61306ea5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,7 +66,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, 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, 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 1bc886f76..fd8c68131 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -8,14 +8,12 @@ git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory= black~=23.3 bumpversion~=0.6.0 click~=8.1 -flake8~=5.0;python_version=="3.7" flake8~=6.0;python_version>="3.8" flaky~=3.7 freezegun~=1.2 ipdb~=0.13.13 mypy==1.2.0 # patch updates have historically introduced breaking changes pip-tools~=6.13 -pre-commit~=2.21;python_version=="3.7" pre-commit~=3.2;python_version>="3.8" pre-commit-hooks~=4.4 pytest~=7.3 @@ -24,7 +22,6 @@ pytest-dotenv~=0.5.2 pytest-logbook~=1.2 pytest-xdist~=3.2 pytz~=2023.3 -tox~=3.0;python_version=="3.7" tox~=4.4;python_version>="3.8" types-pytz~=2023.3 types-requests~=2.28 diff --git a/setup.py b/setup.py index 914c553ca..33bc7e4ea 100644 --- a/setup.py +++ b/setup.py @@ -3,10 +3,10 @@ import sys import re -# require python 3.7 or newer -if sys.version_info < (3, 7): +# 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.7 or higher.") + print("Please upgrade to Python 3.8 or higher.") sys.exit(1) @@ -90,10 +90,9 @@ def _get_dbt_core_version(): "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", ], - python_requires=">=3.7", + python_requires=">=3.8", ) diff --git a/tox.ini b/tox.ini index 0747b61f5..1bba38b6c 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ skipsdist = True envlist = unit, flake8, integration-spark-thrift -[testenv:{unit,py37,py38,py39,py310,py}] +[testenv:{unit,py38,py39,py310,py}] allowlist_externals = /bin/bash commands = /bin/bash -c '{envpython} -m pytest -v {posargs} tests/unit'