From 940633cee64b9ad262b7acd451f3913a251ed7d4 Mon Sep 17 00:00:00 2001 From: Doug Latornell Date: Thu, 9 Jan 2025 11:41:54 -0800 Subject: [PATCH] Add Python 3.13 support (#124) * Add Python 3.13 to GHA pytest-with-coverage matrix Include Python 3.13 in the GitHub Actions workflow for pytest with coverage. This ensures compatibility and testing for the latest Python version. * Change to Python 3.13 for development Update Python version to 3.13 in development and documentation environments, and revise documentation to reflect Python 3.11 as the minimum supported version. Bump various package versions across requirements and configuration files to their latest stable releases. * Update breaking changes doc for version 25.1 Document the incompatibility of version 25.1 with earlier versions, in particular, the new minimum Python version requirement (3.11) and the use of Python 3.13 for development. --- .github/workflows/pytest-with-coverage.yaml | 2 +- SalishSeaTools/docs/pkg_development.rst | 21 +++++++------- SalishSeaTools/envs/environment-dev.yaml | 2 +- SalishSeaTools/envs/requirements.txt | 32 ++++++++++----------- docs/breaking_changes.rst | 12 ++++++++ environment-rtd.yaml | 2 +- 6 files changed, 40 insertions(+), 31 deletions(-) diff --git a/.github/workflows/pytest-with-coverage.yaml b/.github/workflows/pytest-with-coverage.yaml index e967e747..51ae62a1 100644 --- a/.github/workflows/pytest-with-coverage.yaml +++ b/.github/workflows/pytest-with-coverage.yaml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ '3.11', '3.12' ] + python-version: [ '3.11', '3.12', '3.13' ] uses: UBC-MOAD/gha-workflows/.github/workflows/pytest-with-coverage.yaml@main with: python-version: ${{ matrix.python-version }} diff --git a/SalishSeaTools/docs/pkg_development.rst b/SalishSeaTools/docs/pkg_development.rst index 6a8a1982..e9a9473d 100644 --- a/SalishSeaTools/docs/pkg_development.rst +++ b/SalishSeaTools/docs/pkg_development.rst @@ -16,26 +16,25 @@ .. _SalishSeaToolsPackageDevelopment: -***************************************** -:kbd:`SalishSeaTools` Package Development -***************************************** +******************************************** +:py:obj:`SalishSeaTools` Package Development +******************************************** .. _SalishSeaToolsPythonVersions: Python Versions =============== -The :kbd:`SalishSeaTools` package is developed and tested using `Python`_ 3.9. -The package uses some Python language features that are not available in versions prior to 3.6, -in particular: +.. image:: https://img.shields.io/python/required-version-toml?tomlFilePath=https://raw.githubusercontent.com/SalishSeaCast/SalishSeaCmd/main/pyproject.toml&logo=Python&logoColor=gold&label=Python + :target: https://docs.python.org/3 + :alt: Python Version from PEP 621 TOML -* `formatted string literals`_ - (aka *f-strings*) -* the `file system path protocol`_ +The :py:obj:`SalishSeaTools` package is developed using `Python`_ 3.13. +The minimum supported Python version is 3.11. +The :ref:`SalishSeaToolsContinuousIntegration` workflow on GitHub ensures that the package +is tested for all versions of Python>=3.11. .. _Python: https://www.python.org/ -.. _formatted string literals: https://docs.python.org/3/reference/lexical_analysis.html#f-strings -.. _file system path protocol: https://docs.python.org/3/whatsnew/3.6.html#whatsnew36-pep519 .. _SalishSeaToolsGettingTheCode: diff --git a/SalishSeaTools/envs/environment-dev.yaml b/SalishSeaTools/envs/environment-dev.yaml index 1468d85c..28b329d5 100644 --- a/SalishSeaTools/envs/environment-dev.yaml +++ b/SalishSeaTools/envs/environment-dev.yaml @@ -36,7 +36,7 @@ dependencies: - openpyxl - pandas - pip - - python=3.12 + - python=3.13 - pytz - python-dateutil - pyyaml diff --git a/SalishSeaTools/envs/requirements.txt b/SalishSeaTools/envs/requirements.txt index 445c20fc..83fd983f 100644 --- a/SalishSeaTools/envs/requirements.txt +++ b/SalishSeaTools/envs/requirements.txt @@ -9,7 +9,7 @@ alabaster==1.0.0 angles==2.0 -anyio==4.7.0 +anyio==4.8.0 argon2-cffi==23.1.0 argon2-cffi-bindings==21.2.0 arrow==1.3.0 @@ -29,7 +29,7 @@ certifi==2024.12.14 cffi==1.17.1 cfgv==3.3.1 cftime==1.6.4 -charset-normalizer==3.4.0 +charset-normalizer==3.4.1 click==8.1.8 cliff==4.8.0 cmd2==2.5.8 @@ -68,11 +68,11 @@ httpcore==1.0.7 httpx==0.28.1 hyperframe==6.0.1 hyperlink==21.0.0 -identify==2.6.4 +identify==2.6.5 idna==3.10 imagesize==1.4.1 importlib_metadata==8.5.0 -importlib_resources==6.4.5 +importlib_resources==6.5.2 iniconfig==2.0.0 ipdb==0.13.13 ipykernel==6.29.5 @@ -92,7 +92,7 @@ jupyter_client==8.6.3 jupyter_core==5.7.2 jupyter-events==0.11.0 jupyter-lsp==2.2.5 -jupyter_server==2.14.2 +jupyter_server==2.15.0 jupyter_server_terminals==0.5.3 jupyterlab==4.3.4 jupyterlab_pygments==0.3.0 @@ -105,12 +105,12 @@ MarkupSafe==3.0.2 matplotlib==3.10.0 matplotlib-inline==0.1.7 mdurl==0.1.2 -mistune==3.0.2 +mistune==3.1.0 more-itertools==10.5.0 munkres==1.1.4 mypy_extensions==1.0.0 -nbclient==0.10.1 -nbconvert==7.16.4 +nbclient==0.10.2 +nbconvert==7.16.5 nbformat==5.10.4 nbsphinx==0.9.5 nest_asyncio==1.6.0 @@ -128,7 +128,7 @@ pathspec==0.12.1 pbr==6.1.0 pexpect==4.9.0 pickleshare==0.7.5 -pillow==11.0.0 +pillow==11.1.0 pip==24.3.1 pkgutil_resolve_name==1.3.10 platformdirs==4.3.6 @@ -137,12 +137,12 @@ pre_commit==4.0.1 prettytable==3.12.0 prometheus_client==0.21.1 prompt_toolkit==3.0.48 -psutil==6.1.0 +psutil==6.1.1 ptyprocess==0.7.0 pure_eval==0.2.3 pycparser==2.22 -Pygments==2.18.0 -pyparsing==3.2.0 +Pygments==2.19.1 +pyparsing==3.2.1 pyperclip==1.9.0 PySide6==6.8.1 PySocks==1.7.1 @@ -161,7 +161,7 @@ rfc3339_validator==0.1.4 rfc3986-validator==0.1.1 rich==13.9.4 rpds-py==0.22.3 -SalishSeaTools==24.1.dev0 +SalishSeaTools==25.1.dev0 scipy==1.15.0 SecretStorage==3.3.3 Send2Trash==1.8.3 @@ -198,16 +198,14 @@ typing_extensions==4.12.2 typing_utils==0.1.0 tzdata==2024.2 ukkonen==1.0.1 -unicodedata2==15.1.0 uri-template==1.3.0 -urllib3==2.2.3 +urllib3==2.3.0 userpath==1.9.2 virtualenv==20.28.1 wcwidth==0.2.13 webcolors==24.11.1 webencodings==0.5.1 websocket-client==1.8.0 -wheel==0.45.1 -xarray==2025.1.0 +xarray==2025.1.1 zipp==3.21.0 zstandard==0.23.0 diff --git a/docs/breaking_changes.rst b/docs/breaking_changes.rst index 0809a6c2..3f4c8708 100644 --- a/docs/breaking_changes.rst +++ b/docs/breaking_changes.rst @@ -22,6 +22,18 @@ Changes That Break Backward Compatibility ***************************************** +.. _BreakingChangesVersion25.1: + +Version 25.1 (unreleased) +========================= + +The following changes that were introduced in version 25.1 of the ``tools`` repository +are incompatible with earlier versions: + +* The minimum supported version of Python is 3.11. + Development of the :py:obj:`SalishSeaTools` package is done using Python 3.13. + + .. _BreakingChangesVersion24.1: Version 24.1 (2025-01-09) diff --git a/environment-rtd.yaml b/environment-rtd.yaml index db65d162..b7c3d77e 100644 --- a/environment-rtd.yaml +++ b/environment-rtd.yaml @@ -12,7 +12,7 @@ dependencies: - jupyter - matplotlib - pip - - python=3.12 + - python=3.13 # Sphinx and extensions we use - nbsphinx==0.9.5