From b12b3924ca9b402da6c8cd69a94597b58a33129d Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Mon, 21 Oct 2024 16:38:48 -0400 Subject: [PATCH] drop support for python 3.8 --- .../unreleased/Breaking Changes-20241016-184157.yaml | 6 ++++++ .github/workflows/main.yml | 8 ++++---- .pre-commit-config.yaml | 6 +++--- CONTRIBUTING.md | 2 +- Makefile | 8 ++++---- setup.py | 8 +++----- tox.ini | 10 +++++----- 7 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 .changes/unreleased/Breaking Changes-20241016-184157.yaml diff --git a/.changes/unreleased/Breaking Changes-20241016-184157.yaml b/.changes/unreleased/Breaking Changes-20241016-184157.yaml new file mode 100644 index 000000000..0a2104e60 --- /dev/null +++ b/.changes/unreleased/Breaking Changes-20241016-184157.yaml @@ -0,0 +1,6 @@ +kind: Breaking Changes +body: Drop support for Python 3.8 +time: 2024-10-16T18:41:57.721002-04:00 +custom: + Author: mikealfare + Issue: "1121" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f00ce8c24..5ec018d9d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4.3.0 with: - python-version: '3.8' + python-version: '3.9' - name: Install python dependencies run: | @@ -78,7 +78,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10"] env: TOXENV: "unit" @@ -129,7 +129,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4.3.0 with: - python-version: '3.8' + python-version: '3.9' - name: Install python dependencies run: | @@ -175,7 +175,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-12, windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10"] steps: - name: Set up Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b098e0c2..722f385eb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ # TODO: remove global exclusion of tests when testing overhaul is complete exclude: '^tests/.*' -# Force all unspecified python hooks to run python 3.8 +# Force all unspecified python hooks to run python 3.9 default_language_version: python: python3 @@ -24,14 +24,14 @@ repos: additional_dependencies: ['click==8.0.4'] args: - "--line-length=99" - - "--target-version=py38" + - "--target-version=py39" - id: black alias: black-check stages: [manual] additional_dependencies: ['click==8.0.4'] args: - "--line-length=99" - - "--target-version=py38" + - "--target-version=py39" - "--check" - "--diff" - repo: https://github.com/pycqa/flake8 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d6e76d31..4acf6807d 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.9 and `flake8` checks in parallel with `tox -p`. Also, you can run unit tests for specific python versions with `tox -e py39`. 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/Makefile b/Makefile index a520c425f..452597248 100644 --- a/Makefile +++ b/Makefile @@ -32,14 +32,14 @@ linecheck: ## Checks for all Python lines 100 characters or more find dbt -type f -name "*.py" -exec grep -I -r -n '.\{100\}' {} \; .PHONY: unit -unit: ## Runs unit tests with py38. +unit: ## Runs unit tests with py39. @\ - tox -e py38 + tox -e py39 .PHONY: test -test: ## Runs unit tests with py38 and code checks against staged changes. +test: ## Runs unit tests with py39 and code checks against staged changes. @\ - tox -p -e py38; \ + tox -p -e py39; \ pre-commit run black-check --hook-stage manual | grep -v "INFO"; \ pre-commit run flake8-check --hook-stage manual | grep -v "INFO"; \ pre-commit run mypy-check --hook-stage manual | grep -v "INFO" diff --git a/setup.py b/setup.py index 4e2d3a8a6..59b3a244c 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, 9): 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.9 or higher.") sys.exit(1) @@ -90,10 +90,8 @@ 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.9", ) diff --git a/tox.ini b/tox.ini index 31456b089..4223a86ca 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,py39,py310,py}] allowlist_externals = /bin/bash commands = /bin/bash -c '{envpython} -m pytest -v {posargs} tests/unit' @@ -16,7 +16,7 @@ deps = [testenv:integration-spark-databricks-http] allowlist_externals = /bin/bash -basepython = python3.8 +basepython = python3.9 commands = /bin/bash -c '{envpython} -m pytest -v --profile databricks_http_cluster {posargs} -n4 tests/functional/adapter/*' passenv = DBT_* @@ -29,7 +29,7 @@ deps = [testenv:integration-spark-databricks-odbc-cluster] allowlist_externals = /bin/bash -basepython = python3.8 +basepython = python3.9 commands = /bin/bash -c '{envpython} -m pytest -v --profile databricks_cluster {posargs} -n4 tests/functional/adapter/*' /bin/bash -c '{envpython} -m pytest -v -m profile_databricks_cluster {posargs} -n4 tests/integration/*' passenv = @@ -44,7 +44,7 @@ deps = [testenv:integration-spark-databricks-odbc-sql-endpoint] allowlist_externals = /bin/bash -basepython = python3.8 +basepython = python3.9 commands = /bin/bash -c '{envpython} -m pytest -v --profile databricks_sql_endpoint {posargs} -n4 tests/functional/adapter/*' /bin/bash -c '{envpython} -m pytest -v -m profile_databricks_sql_endpoint {posargs} -n4 tests/integration/*' passenv = @@ -60,7 +60,7 @@ deps = [testenv:integration-spark-thrift] allowlist_externals = /bin/bash -basepython = python3.8 +basepython = python3.9 commands = /bin/bash -c '{envpython} -m pytest -v --profile apache_spark {posargs} -n4 tests/functional/adapter/*' /bin/bash -c '{envpython} -m pytest -v -m profile_apache_spark {posargs} -n4 tests/integration/*' passenv =