diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e36912b9e..626f5060ed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "3.0", "3.1"] dbt-version: ["1.10"] exclude: @@ -76,6 +76,25 @@ jobs: airflow-version: "2.7" - python-version: "3.12" airflow-version: "2.8" + # Apache Airflow versions prior to 3.1.0 have not been tested with Python 3.13. + - python-version: "3.13" + airflow-version: "2.4" + - python-version: "3.13" + airflow-version: "2.5" + - python-version: "3.13" + airflow-version: "2.6" + - python-version: "3.13" + airflow-version: "2.7" + - python-version: "3.13" + airflow-version: "2.8" + - python-version: "3.13" + airflow-version: "2.9" + - python-version: "3.13" + airflow-version: "2.10" + - python-version: "3.13" + airflow-version: "2.11" + - python-version: "3.13" + airflow-version: "3.0" steps: - uses: actions/checkout@v6.0.0 with: @@ -119,7 +138,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.13"] airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "3.0", "3.1"] dbt-version: ["1.10"] exclude: @@ -127,6 +146,25 @@ jobs: airflow-version: "2.4" - python-version: "3.11" airflow-version: "2.5" + # Apache Airflow versions prior to 3.1.0 have not been tested with Python 3.13. + - python-version: "3.13" + airflow-version: "2.4" + - python-version: "3.13" + airflow-version: "2.5" + - python-version: "3.13" + airflow-version: "2.6" + - python-version: "3.13" + airflow-version: "2.7" + - python-version: "3.13" + airflow-version: "2.8" + - python-version: "3.13" + airflow-version: "2.9" + - python-version: "3.13" + airflow-version: "2.10" + - python-version: "3.13" + airflow-version: "2.11" + - python-version: "3.13" + airflow-version: "3.0" services: postgres: image: postgres@sha256:4cd697181d4bd3ddc41a09012f339fa8cb5a8cd3d8b30130ea8378c176b6c494 # 14.18 diff --git a/pyproject.toml b/pyproject.toml index a43ca252d2..d060acf77d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [ "aenum", @@ -167,7 +168,7 @@ dependencies = [ pre-install-commands = ["sh scripts/test/pre-install-airflow.sh {matrix:airflow} {matrix:python}"] [[tool.hatch.envs.tests.matrix]] -python = ["3.10", "3.11", "3.12"] +python = ["3.10", "3.11", "3.12", "3.13"] airflow = ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "3.0", "3.1"] dbt = ["1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "2.0"] @@ -227,7 +228,7 @@ serve = "sphinx-autobuild docs docs/_build" ###################################### [tool.black] line-length = 120 -target-version = ['py310', 'py311', 'py312'] +target-version = ["py310", "py311", "py312", "py313"] [tool.isort] profile = "black" diff --git a/tests/operators/test_base.py b/tests/operators/test_base.py index 7394a7df95..400a97a06b 100644 --- a/tests/operators/test_base.py +++ b/tests/operators/test_base.py @@ -20,29 +20,17 @@ ) -@pytest.mark.skipif( - (sys.version_info.major, sys.version_info.minor) == (3, 12), - reason="The error message for the abstract class instantiation seems to have changed between Python 3.11 and 3.12", -) def test_dbt_base_is_abstract(): - """Tests that the abstract base operator cannot be instantiated since the base_cmd is not defined.""" - expected_error = ( - "Can't instantiate abstract class AbstractDbtBase with abstract methods base_cmd, build_and_run_cmd" - ) - with pytest.raises(TypeError, match=expected_error): - AbstractDbtBase(project_dir="project_dir") + if sys.version_info >= (3, 12): + expected_error = ( + "Can't instantiate abstract class AbstractDbtBase without an implementation for abstract methods " + "'base_cmd', 'build_and_run_cmd'" + ) + else: + expected_error = ( + "Can't instantiate abstract class AbstractDbtBase with abstract methods base_cmd, build_and_run_cmd" + ) - -@pytest.mark.skipif( - (sys.version_info.major, sys.version_info.minor) != (3, 12), - reason="The error message for the abstract class instantiation seems to have changed between Python 3.11 and 3.12", -) -def test_dbt_base_operator_is_abstract_py12(): - """Tests that the abstract base operator cannot be instantiated since the base_cmd is not defined.""" - expected_error = ( - "Can't instantiate abstract class AbstractDbtBase without an implementation for abstract methods " - "'base_cmd', 'build_and_run_cmd'" - ) with pytest.raises(TypeError, match=expected_error): AbstractDbtBase(project_dir="project_dir")