From fa7c45d94f8969dcfcdc8530e2bb8cfffad6a47f Mon Sep 17 00:00:00 2001 From: Li Nguyen <90609403+huong-li-nguyen@users.noreply.github.com> Date: Mon, 18 Dec 2023 11:16:07 +0100 Subject: [PATCH] Add Python 3.12 to tests (#216) Co-authored-by: Antony Milne --- .../workflows/test-integration-vizro-ai.yml | 2 + .../workflows/test-integration-vizro-core.yml | 2 + .github/workflows/test-unit-vizro-ai.yml | 2 + .github/workflows/test-unit-vizro-core.yml | 2 + README.md | 2 +- vizro-ai/README.md | 4 +- ...4_163129_huong_li_nguyen_add_python_312.md | 48 +++++++++++++++++++ vizro-ai/hatch.toml | 2 +- vizro-ai/pyproject.toml | 9 +++- vizro-core/README.md | 2 +- ...4_163119_huong_li_nguyen_add_python_312.md | 48 +++++++++++++++++++ vizro-core/hatch.toml | 6 ++- vizro-core/pyproject.toml | 9 +++- 13 files changed, 128 insertions(+), 10 deletions(-) create mode 100644 vizro-ai/changelog.d/20231214_163129_huong_li_nguyen_add_python_312.md create mode 100644 vizro-core/changelog.d/20231214_163119_huong_li_nguyen_add_python_312.md diff --git a/.github/workflows/test-integration-vizro-ai.yml b/.github/workflows/test-integration-vizro-ai.yml index d04faa4fe..706be2f1d 100644 --- a/.github/workflows/test-integration-vizro-ai.yml +++ b/.github/workflows/test-integration-vizro-ai.yml @@ -30,6 +30,8 @@ jobs: hatch-env: all.py3.10 - python-version: "3.11" hatch-env: all.py3.11 + - python-version: "3.12" + hatch-env: all.py3.12 - python-version: "3.11" hatch-env: lower-bounds label: lower bounds diff --git a/.github/workflows/test-integration-vizro-core.yml b/.github/workflows/test-integration-vizro-core.yml index f0ce1cd6d..31fe80a11 100644 --- a/.github/workflows/test-integration-vizro-core.yml +++ b/.github/workflows/test-integration-vizro-core.yml @@ -32,6 +32,8 @@ jobs: hatch-env: all.py3.10 - python-version: "3.11" hatch-env: all.py3.11 + - python-version: "3.12" + hatch-env: all.py3.12 - python-version: "3.11" hatch-env: lower-bounds label: lower bounds diff --git a/.github/workflows/test-unit-vizro-ai.yml b/.github/workflows/test-unit-vizro-ai.yml index 69c28e008..1f6ca0714 100644 --- a/.github/workflows/test-unit-vizro-ai.yml +++ b/.github/workflows/test-unit-vizro-ai.yml @@ -30,6 +30,8 @@ jobs: hatch-env: all.py3.10 - python-version: "3.11" hatch-env: all.py3.11 + - python-version: "3.12" + hatch-env: all.py3.12 - python-version: "3.11" hatch-env: lower-bounds label: lower bounds diff --git a/.github/workflows/test-unit-vizro-core.yml b/.github/workflows/test-unit-vizro-core.yml index f7864bbc0..6872efee2 100644 --- a/.github/workflows/test-unit-vizro-core.yml +++ b/.github/workflows/test-unit-vizro-core.yml @@ -32,6 +32,8 @@ jobs: hatch-env: all.py3.10 - python-version: "3.11" hatch-env: all.py3.11 + - python-version: "3.12" + hatch-env: all.py3.12 - python-version: "3.11" hatch-env: lower-bounds label: lower bounds diff --git a/README.md b/README.md index b71731af1..2d204a7c1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@
-[![Python version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue.svg)](https://pypi.org/project/vizro/) +[![Python version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg)](https://pypi.org/project/vizro/) [![PyPI version](https://badge.fury.io/py/vizro.svg)](https://badge.fury.io/py/vizro) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/mckinsey/vizro/blob/main/LICENSE.md) [![Documentation](https://readthedocs.org/projects/vizro/badge/?version=stable)](https://vizro.readthedocs.io/) diff --git a/vizro-ai/README.md b/vizro-ai/README.md index 374ffa851..e6ad4baff 100644 --- a/vizro-ai/README.md +++ b/vizro-ai/README.md @@ -1,4 +1,6 @@ -# Vizro-AI README +# Vizro-AI + +[![Python version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg)](https://pypi.org/project/vizro/) Vizro-AI is a tool for generating visualizations. diff --git a/vizro-ai/changelog.d/20231214_163129_huong_li_nguyen_add_python_312.md b/vizro-ai/changelog.d/20231214_163129_huong_li_nguyen_add_python_312.md new file mode 100644 index 000000000..f1f65e73c --- /dev/null +++ b/vizro-ai/changelog.d/20231214_163129_huong_li_nguyen_add_python_312.md @@ -0,0 +1,48 @@ + + + + + + + + + diff --git a/vizro-ai/hatch.toml b/vizro-ai/hatch.toml index d04a70dde..ff922baed 100644 --- a/vizro-ai/hatch.toml +++ b/vizro-ai/hatch.toml @@ -1,7 +1,7 @@ [envs.all] [[envs.all.matrix]] -python = ["3.9", "3.10", "3.11"] +python = ["3.9", "3.10", "3.11", "3.12"] [envs.changelog] dependencies = ["scriv"] diff --git a/vizro-ai/pyproject.toml b/vizro-ai/pyproject.toml index 898bfc411..61357282f 100644 --- a/vizro-ai/pyproject.toml +++ b/vizro-ai/pyproject.toml @@ -10,7 +10,8 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11" + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12" ] dependencies = [ "pandas", @@ -48,4 +49,8 @@ parallel = true source_pkgs = ["vizro_ai"] [tool.pytest.ini_options] -filterwarnings = "error" +filterwarnings = [ + "error", + # Ignore this warning here as it comes from pandas until pandas is made compatible with Python 3.12 + 'ignore:.*utcfromtimestamp.*:DeprecationWarning' +] diff --git a/vizro-core/README.md b/vizro-core/README.md index f14aae687..9f1bde01d 100644 --- a/vizro-core/README.md +++ b/vizro-core/README.md @@ -11,7 +11,7 @@
-[![Python version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue.svg)](https://pypi.org/project/vizro/) +[![Python version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg)](https://pypi.org/project/vizro/) [![PyPI version](https://badge.fury.io/py/vizro.svg)](https://badge.fury.io/py/vizro) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/mckinsey/vizro/blob/main/LICENSE.md) [![Documentation](https://readthedocs.org/projects/vizro/badge/?version=stable)](https://vizro.readthedocs.io/) diff --git a/vizro-core/changelog.d/20231214_163119_huong_li_nguyen_add_python_312.md b/vizro-core/changelog.d/20231214_163119_huong_li_nguyen_add_python_312.md new file mode 100644 index 000000000..f1f65e73c --- /dev/null +++ b/vizro-core/changelog.d/20231214_163119_huong_li_nguyen_add_python_312.md @@ -0,0 +1,48 @@ + + + + + + + + + diff --git a/vizro-core/hatch.toml b/vizro-core/hatch.toml index 980f6151b..b9afb249a 100644 --- a/vizro-core/hatch.toml +++ b/vizro-core/hatch.toml @@ -1,11 +1,13 @@ [envs.all] [[envs.all.matrix]] -python = ["3.8", "3.9", "3.10", "3.11"] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] [envs.all.overrides] +# Kedro is currently not compatible with Python 3.12 and returns exceptions when trying to run the unit tests on +# Python 3.12. These exceptions turned out to be difficult to ignore: https://github.com/mckinsey/vizro/pull/216 matrix.python.features = [ - {value = "kedro", if = ["3.8", "3.9", "3.10"]} + {value = "kedro", if = ["3.8", "3.9", "3.10", "3.11"]} ] [envs.changelog] diff --git a/vizro-core/pyproject.toml b/vizro-core/pyproject.toml index 8f59e5d6e..4220d27b0 100644 --- a/vizro-core/pyproject.toml +++ b/vizro-core/pyproject.toml @@ -14,7 +14,8 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11" + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12" ] dependencies = [ "dash>=2.14.1", # 2.14.1 needed for compatibility with werkzeug @@ -71,6 +72,10 @@ addopts = [ # Allow test files to have the same name in different directories. "--import-mode=importlib" ] -filterwarnings = "error" +filterwarnings = [ + "error", + # Ignore this warning here as it comes from pandas until pandas is made compatible with Python 3.12 + "ignore:.*utcfromtimestamp:DeprecationWarning" +] norecursedirs = ["tests/tests_utils", "tests/js"] pythonpath = ["tests/tests_utils"]