From cc28696dec8703b95457f9f3d405fc039eb7aafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Fri, 2 Feb 2024 09:05:01 +0100 Subject: [PATCH] Add official support for Python 3.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close #3287. Signed-off-by: Juan Luis Cano Rodríguez --- .github/workflows/all-checks.yml | 6 +++--- .github/workflows/docs-only-checks.yml | 2 +- RELEASE.md | 1 + kedro/__init__.py | 2 +- tests/test_import.py | 8 ++++---- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/all-checks.yml b/.github/workflows/all-checks.yml index f63de1fbbc..2dfb971e3d 100644 --- a/.github/workflows/all-checks.yml +++ b/.github/workflows/all-checks.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: os: [ windows-latest, ubuntu-latest ] - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] uses: ./.github/workflows/unit-tests.yml with: os: ${{ matrix.os }} @@ -36,7 +36,7 @@ jobs: strategy: matrix: os: [ windows-latest, ubuntu-latest ] - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] uses: ./.github/workflows/e2e-tests.yml with: os: ${{ matrix.os }} @@ -59,7 +59,7 @@ jobs: strategy: matrix: os: [ windows-latest, ubuntu-latest ] - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] uses: ./.github/workflows/pip-compile.yml with: os: ${{ matrix.os }} diff --git a/.github/workflows/docs-only-checks.yml b/.github/workflows/docs-only-checks.yml index 1af4aa53e8..d0cca88abd 100644 --- a/.github/workflows/docs-only-checks.yml +++ b/.github/workflows/docs-only-checks.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] uses: ./.github/workflows/lint.yml with: os: ${{ matrix.os }} diff --git a/RELEASE.md b/RELEASE.md index 2ca1de007e..d8564ac462 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,6 +2,7 @@ ## Major features and improvements * Create the debugging line magic `%load_node` for Jupyter Notebook and Jupyter Lab. +* Add official support for Python 3.12. ## Bug fixes and other changes * Updated CLI Command `kedro catalog resolve` to work with dataset factories that use `PartitionedDataset`. diff --git a/kedro/__init__.py b/kedro/__init__.py index a538fcbecc..53a31804b3 100644 --- a/kedro/__init__.py +++ b/kedro/__init__.py @@ -21,7 +21,7 @@ class KedroPythonVersionWarning(UserWarning): warnings.simplefilter("default", KedroDeprecationWarning) warnings.simplefilter("error", KedroPythonVersionWarning) -if sys.version_info >= (3, 12): +if sys.version_info >= (3, 13): warnings.warn( """Kedro is not yet fully compatible with this Python version. To proceed at your own risk and ignore this warning, diff --git a/tests/test_import.py b/tests/test_import.py index a9aa72e21a..6dc9da4df4 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -4,8 +4,8 @@ def test_import_kedro_with_no_official_support_raise_error(mocker): - """Test importing kedro with python>=3.12 should fail""" - mocker.patch("kedro.sys.version_info", (3, 12)) + """Test importing kedro with python>=3.13 should fail""" + mocker.patch("kedro.sys.version_info", (3, 13)) # We use the parent class to avoid issues with `exec_module` with pytest.raises(UserWarning) as excinfo: @@ -15,8 +15,8 @@ def test_import_kedro_with_no_official_support_raise_error(mocker): def test_import_kedro_with_no_official_support_emits_warning(mocker): - """Test importing kedro python>=3.12 and controlled warnings should work""" - mocker.patch("kedro.sys.version_info", (3, 12)) + """Test importing kedro python>=3.13 and controlled warnings should work""" + mocker.patch("kedro.sys.version_info", (3, 13)) mocker.patch("kedro.sys.warnoptions", ["default:Kedro is not yet fully compatible"]) # We use the parent class to avoid issues with `exec_module`