diff --git a/.changes/unreleased/Dependencies-20251027-162502.yaml b/.changes/unreleased/Dependencies-20251027-162502.yaml new file mode 100644 index 00000000000..26247755027 --- /dev/null +++ b/.changes/unreleased/Dependencies-20251027-162502.yaml @@ -0,0 +1,6 @@ +kind: Dependencies +body: Drop support for python 3.9 +time: 2025-10-27T16:25:02.435562-05:00 +custom: + Author: QMalcolm + Issue: "12118" diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 7fe4b04e870..744bcdc127c 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -62,7 +62,7 @@ body: description: | examples: - **OS**: Ubuntu 24.04 - - **Python**: 3.9.12 (`python3 --version`) + - **Python**: 3.10.12 (`python3 --version`) - **dbt-core**: 1.1.1 (`dbt --version`) value: | - OS: diff --git a/.github/ISSUE_TEMPLATE/regression-report.yml b/.github/ISSUE_TEMPLATE/regression-report.yml index e94c9d162ea..e4ba39dff75 100644 --- a/.github/ISSUE_TEMPLATE/regression-report.yml +++ b/.github/ISSUE_TEMPLATE/regression-report.yml @@ -56,7 +56,7 @@ body: description: | examples: - **OS**: Ubuntu 24.04 - - **Python**: 3.9.12 (`python3 --version`) + - **Python**: 3.10.12 (`python3 --version`) - **dbt-core (working version)**: 1.1.1 (`dbt --version`) - **dbt-core (regression version)**: 1.2.0 (`dbt --version`) value: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 772b5298a0e..a3bcfb7383a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,7 +54,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: '3.9' + python-version: '3.10' - name: Install python dependencies run: | @@ -77,7 +77,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] + python-version: ["3.10", "3.11", "3.12", "3.13" ] env: TOXENV: "unit" @@ -142,7 +142,7 @@ jobs: - name: generate include id: generate-include run: | - INCLUDE=('"python-version":"3.9","os":"windows-latest"' '"python-version":"3.9","os":"macos-14"' ) + INCLUDE=('"python-version":"3.10","os":"windows-latest"' '"python-version":"3.10","os":"macos-14"' ) INCLUDE_GROUPS="[" for include in ${INCLUDE[@]}; do for group in $(seq 1 ${{ env.PYTHON_INTEGRATION_TEST_WORKERS }}); do @@ -164,7 +164,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] + python-version: [ "3.10", "3.11", "3.12", "3.13" ] os: ["ubuntu-latest"] split-group: ${{ fromJson(needs.integration-metadata.outputs.split-groups) }} env: @@ -361,7 +361,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: '3.9' + python-version: '3.10' - name: Install python dependencies run: | diff --git a/.github/workflows/model_performance.yml b/.github/workflows/model_performance.yml index 965a14b24bf..b7e0411ea73 100644 --- a/.github/workflows/model_performance.yml +++ b/.github/workflows/model_performance.yml @@ -150,7 +150,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v6 with: - python-version: "3.9" + python-version: "3.10" - name: Install dbt run: pip install dbt-postgres==${{ needs.set-variables.outputs.release_id }} diff --git a/.github/workflows/schema-check.yml b/.github/workflows/schema-check.yml index f8280a6e86e..72e1bc63e53 100644 --- a/.github/workflows/schema-check.yml +++ b/.github/workflows/schema-check.yml @@ -43,7 +43,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: 3.9 + python-version: "3.10" - name: Checkout dbt repo uses: actions/checkout@v4 diff --git a/.github/workflows/structured-logging-schema-check.yml b/.github/workflows/structured-logging-schema-check.yml index 3ee464f9fc4..a79764dcba6 100644 --- a/.github/workflows/structured-logging-schema-check.yml +++ b/.github/workflows/structured-logging-schema-check.yml @@ -96,7 +96,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v6 with: - python-version: "3.9" + python-version: "3.10" - name: Install python dependencies run: | diff --git a/.github/workflows/test-repeater.yml b/.github/workflows/test-repeater.yml index 8f09c5b789c..533fa39a89e 100644 --- a/.github/workflows/test-repeater.yml +++ b/.github/workflows/test-repeater.yml @@ -27,7 +27,6 @@ on: description: 'Version of Python to Test Against' type: choice options: - - '3.9' - '3.10' - '3.11' os: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 36b2716efe3..67d5d846c99 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ exclude: ^(core/dbt/docs/build/|core/dbt/common/events/types_pb2.py|core/dbt/adapters/events/adapter_types_pb2.py) -# Force all unspecified python hooks to run python 3.9 +# Force all unspecified python hooks to run python 3.10 default_language_version: python: python3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2616e4607de..a7ef2f2ec49 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,15 +2,34 @@ `dbt-core` is open source software. It is what it is today because community members have opened issues, provided feedback, and [contributed to the knowledge loop](https://www.getdbt.com/dbt-labs/values/). Whether you are a seasoned open source contributor or a first-time committer, we welcome and encourage you to contribute code, documentation, ideas, or problem statements to this project. -1. [About this document](#about-this-document) -2. [Getting the code](#getting-the-code) -3. [Setting up an environment](#setting-up-an-environment) -4. [Running dbt-core in development](#running-dbt-core-in-development) -5. [Testing dbt-core](#testing) -6. [Debugging](#debugging) -7. [Adding or modifying a changelog entry](#adding-or-modifying-a-changelog-entry) -8. [Submitting a Pull Request](#submitting-a-pull-request) -9. [Troubleshooting Tips](#troubleshooting-tips) +- [Contributing to `dbt-core`](#contributing-to-dbt-core) + - [About this document](#about-this-document) + - [Notes](#notes) + - [Getting the code](#getting-the-code) + - [Installing git](#installing-git) + - [External contributors](#external-contributors) + - [dbt Labs contributors](#dbt-labs-contributors) + - [Setting up an environment](#setting-up-an-environment) + - [Tools](#tools) + - [Virtual environments](#virtual-environments) + - [Docker and `docker-compose`](#docker-and-docker-compose) + - [Postgres (optional)](#postgres-optional) + - [Running `dbt-core` in development](#running-dbt-core-in-development) + - [Installation](#installation) + - [Running `dbt-core`](#running-dbt-core) + - [Testing](#testing) + - [Initial setup](#initial-setup) + - [Test commands](#test-commands) + - [Makefile](#makefile) + - [`pre-commit`](#pre-commit) + - [`tox`](#tox) + - [`pytest`](#pytest) + - [Unit, Integration, Functional?](#unit-integration-functional) + - [Debugging](#debugging) + - [Assorted development tips](#assorted-development-tips) + - [Adding or modifying a CHANGELOG Entry](#adding-or-modifying-a-changelog-entry) + - [Submitting a Pull Request](#submitting-a-pull-request) + - [Troubleshooting Tips](#troubleshooting-tips) ## About this document @@ -55,7 +74,7 @@ There are some tools that will be helpful to you in developing locally. While th These are the tools used in `dbt-core` development and testing: -- [`tox`](https://tox.readthedocs.io/en/latest/) to manage virtualenvs across python versions. We currently target the latest patch releases for Python 3.8, 3.9, 3.10 and 3.11 +- [`tox`](https://tox.readthedocs.io/en/latest/) to manage virtualenvs across python versions. We currently target the latest patch releases for Python 3.10, 3.11, 3.12, and 3.13 - [`pytest`](https://docs.pytest.org/en/latest/) to define, discover, and run tests - [`flake8`](https://flake8.pycqa.org/en/latest/) for code linting - [`black`](https://github.com/psf/black) for code formatting diff --git a/Dockerfile.test b/Dockerfile.test index 24be3fdf141..88c1f45a036 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -33,9 +33,6 @@ RUN apt-get update \ python-is-python3 \ python-dev-is-python3 \ python3-pip \ - python3.9 \ - python3.9-dev \ - python3.9-venv \ python3.10 \ python3.10-dev \ python3.10-venv \ diff --git a/core/dbt/cli/options.py b/core/dbt/cli/options.py index c73a4bcd374..0299e581a07 100644 --- a/core/dbt/cli/options.py +++ b/core/dbt/cli/options.py @@ -3,7 +3,7 @@ import click from click import Context -from click.parser import OptionParser, ParsingState +from click.parser import _OptionParser, _ParsingState from dbt.cli.option_types import ChoiceTuple @@ -33,8 +33,8 @@ def __init__(self, *args, **kwargs) -> None: else: assert isinstance(option_type, ChoiceTuple), msg - def add_to_parser(self, parser: OptionParser, ctx: Context): - def parser_process(value: str, state: ParsingState): + def add_to_parser(self, parser: _OptionParser, ctx: Context): + def parser_process(value: str, state: _ParsingState): # method to hook to the parser.process done = False value_list = str.split(value, " ") diff --git a/core/dbt/config/profile.py b/core/dbt/config/profile.py index ada7f30711c..d4b1803bbfa 100644 --- a/core/dbt/config/profile.py +++ b/core/dbt/config/profile.py @@ -68,7 +68,9 @@ def __init__( threads: int, credentials: Credentials, ) -> None: - """Explicitly defining `__init__` to work around bug in Python 3.9.7 + """ + TODO: Is this no longer needed now that 3.9 is no longer supported? + Explicitly defining `__init__` to work around bug in Python 3.9.7 https://bugs.python.org/issue45081 """ self.profile_name = profile_name diff --git a/core/setup.py b/core/setup.py index f4a8b42db74..2b83afe1ea2 100644 --- a/core/setup.py +++ b/core/setup.py @@ -2,9 +2,9 @@ import os import sys -if sys.version_info < (3, 9): +if sys.version_info < (3, 10): print("Error: dbt does not support this version of Python.") - print("Please upgrade to Python 3.9 or higher.") + print("Please upgrade to Python 3.10 or higher.") sys.exit(1) @@ -92,11 +92,10 @@ "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ], - python_requires=">=3.9", + python_requires=">=3.10", )