diff --git a/.changes/unreleased/Breaking Changes-20241016-185117.yaml b/.changes/unreleased/Breaking Changes-20241016-185117.yaml new file mode 100644 index 000000000..55bb37461 --- /dev/null +++ b/.changes/unreleased/Breaking Changes-20241016-185117.yaml @@ -0,0 +1,6 @@ +kind: Breaking Changes +body: Drop support for Python 3.8 +time: 2024-10-16T18:51:17.581547-04:00 +custom: + Author: mikealfare + Issue: "1373" diff --git a/.github/scripts/integration-test-matrix.js b/.github/scripts/integration-test-matrix.js index 1a3136cf6..d8184b816 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.8", "3.9", "3.10", "3.11"]; + const defaultPythonVersion = "3.9"; + const supportedPythonVersions = ["3.9", "3.10", "3.11"]; const supportedAdapters = ["bigquery"]; // if PR, generate matrix based on files changed and PR labels diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4802191b3..5767ca8e8 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -236,10 +236,10 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha }} - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.9" - name: Install python dependencies run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fdbd36dba..e9f70f06d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.9' - name: Install python dependencies run: | @@ -71,7 +71,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11'] env: TOXENV: "unit" @@ -127,7 +127,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.9' - name: Install python dependencies run: | @@ -174,7 +174,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-12, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11'] steps: - name: Set up Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74dbdf99a..4be2eebbb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,14 +24,14 @@ repos: additional_dependencies: ['click~=8.1'] args: - "--line-length=99" - - "--target-version=py38" + - "--target-version=py39" - id: black alias: black-check stages: [manual] additional_dependencies: ['click~=8.1'] 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 e9432d363..57528b8e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,7 +67,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.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`. +`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 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/Makefile b/Makefile index fc6536f98..29cae0ae8 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,3 @@ ubuntu-py311: ## Builds and runs an Ubuntu Python 3.11 development container ubuntu-py39: ## Builds and runs an Ubuntu Python 3.9 development container docker build -f docker_dev/ubuntu.Dockerfile -t dbt-bigquery-ubuntu-py39 . --build-arg version=3.9 docker run --rm -it --name dbt-bigquery-ubuntu-py39 -v $(shell pwd):/opt/code dbt-bigquery-ubuntu-py39 - -.PHONY: ubuntu-py38 -ubuntu-py38: ## Builds and runs an Ubuntu Python 3.8 development container - docker build -f docker_dev/ubuntu.Dockerfile -t dbt-bigquery-ubuntu-py38 . --build-arg version=3.8 - docker run --rm -it --name dbt-bigquery-ubuntu-py38 -v $(shell pwd):/opt/code dbt-bigquery-ubuntu-py38 diff --git a/setup.py b/setup.py index 3f4bad228..fbf91a3dc 100644 --- a/setup.py +++ b/setup.py @@ -2,9 +2,9 @@ import sys # require a supported version of Python -if sys.version_info < (3, 8): +if sys.version_info < (3, 9): print("Error: dbt does not support this version of Python.") - print("Please upgrade to Python 3.8 or higher.") + print("Please upgrade to Python 3.9 or higher.") sys.exit(1) try: @@ -69,10 +69,9 @@ def _dbt_bigquery_version() -> str: "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ], - python_requires=">=3.8", + python_requires=">=3.9", ) diff --git a/tox.ini b/tox.ini index 30e3c5816..7184e0c56 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] skipsdist = True -envlist = py38,py39,py310,py311 +envlist = py39,py310,py311 -[testenv:{unit,py38,py39,py310,py311,py}] +[testenv:{unit,py39,py310,py311,py}] description = unit testing skip_install = true passenv = @@ -13,7 +13,7 @@ deps = -rdev-requirements.txt -e. -[testenv:{integration,py38,py39,py310,py311,py}-{bigquery}] +[testenv:{integration,py39,py310,py311,py}-{bigquery}] description = adapter plugin integration testing skip_install = true passenv = @@ -33,7 +33,7 @@ deps = -rdev-requirements.txt -e. -[testenv:{python-tests,py38,py39,py310,py311,py}] +[testenv:{python-tests,py39,py310,py311,py}] description = python integration testing skip_install = true passenv =