Skip to content

Commit

Permalink
Add official support for Python 3.12
Browse files Browse the repository at this point in the history
Close #3287.

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
  • Loading branch information
astrojuanlu committed Feb 12, 2024
1 parent f54c6fb commit cc28696
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/all-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-only-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion kedro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions tests/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`
Expand Down

0 comments on commit cc28696

Please sign in to comment.