From 47471c11cca879889e90c421278ae14ab9e74105 Mon Sep 17 00:00:00 2001 From: Doug Latornell Date: Sun, 27 Oct 2024 13:02:40 -0700 Subject: [PATCH] Update to Python 3.13 (#77) * Update to Python 3.13 in envs & GHA workflows Upgraded Python from version 3.12 to 3.13 across various YAML files. This includes updates to development, RTD, and HPC environments, as well as GHA pytest-with-coverage and sphinx-linkcheck workflows. * Update to Python 3.13 for development and use Changed Python version references from 3.12 to 3.13 in README and development documentation to align with the latest Python development environment. Updated example pytest output in dev docs accordingly. --- .github/workflows/pytest-with-coverage.yaml | 2 +- .github/workflows/sphinx-linkcheck.yaml | 2 +- README.rst | 2 +- docs/development.rst | 33 ++++++++++----------- envs/environment-dev.yaml | 2 +- envs/environment-hpc.yaml | 2 +- envs/environment-rtd.yaml | 2 +- envs/requirements.txt | 1 - 8 files changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pytest-with-coverage.yaml b/.github/workflows/pytest-with-coverage.yaml index 62a76f5..69101b1 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/.github/workflows/sphinx-linkcheck.yaml b/.github/workflows/sphinx-linkcheck.yaml index cae7dad..b350f55 100644 --- a/.github/workflows/sphinx-linkcheck.yaml +++ b/.github/workflows/sphinx-linkcheck.yaml @@ -15,7 +15,7 @@ jobs: matrix: # Need to specify Python version here because we use test env which gets its # Python version via matrix - python-version: [ '3.12' ] + python-version: [ '3.13' ] uses: UBC-MOAD/gha-workflows/.github/workflows/sphinx-linkcheck.yaml@main with: python-version: ${{ matrix.python-version }} diff --git a/README.rst b/README.rst index 6e1cb5b..3251e42 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ SalishSeaCast NEMO Command Processor | | :target: https://github.com/SalishSeaCast/SalishSeaCmd/releases | | | :alt: Releases | | | .. 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.12/ | +| | :target: https://docs.python.org/3.13/ | | | :alt: Python Version from PEP 621 TOML | | | .. image:: https://img.shields.io/github/issues/SalishSeaCast/SalishSeaCmd?logo=github | | | :target: https://github.com/SalishSeaCast/SalishSeaCmd/issues | diff --git a/docs/development.rst b/docs/development.rst index a8a3f2b..bf4eac7 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -44,7 +44,7 @@ | | :target: https://github.com/SalishSeaCast/SalishSeaCmd/releases | | | :alt: Releases | | | .. 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.12/ | +| | :target: https://docs.python.org/3.13/ | | | :alt: Python Version from PEP 621 TOML | | | .. image:: https://img.shields.io/github/issues/SalishSeaCast/SalishSeaCmd?logo=github | | | :target: https://github.com/SalishSeaCast/SalishSeaCmd/issues | @@ -74,10 +74,10 @@ Python Versions =============== .. 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.12/ + :target: https://docs.python.org/3.13/ :alt: Python Version from PEP 621 TOML -The :kbd:`SalishSeaCmd` package is developed using `Python`_ 3.12. +The :kbd:`SalishSeaCmd` package is developed using `Python`_ 3.13. The minimum supported Python version is 3.11. The :ref:`SalishSeaCmdContinuousIntegration` workflow on GitHub ensures that the package is tested for all versions of Python>=3.11. @@ -328,7 +328,7 @@ The output looks something like: ( development: line 119) ok https://docs.conda.io/en/latest/miniconda.html ( development: line 119) ok https://docs.conda.io/en/latest/ (breaking_changes: line 102) ok https://calver.org/ - ( development: line 23) ok https://docs.python.org/3.12/ + ( development: line 23) ok https://docs.python.org/3.13/ ( api: line 23) ok https://docs.python.org/3/library/constants.html#None (breaking_changes: line 153) ok https://docs.python.org/3/library/constants.html#False (run_description_file/3.6_yaml_file: line 446) ok https://docs.python.org/3/library/constants.html#True @@ -427,24 +427,23 @@ The output looks something like: .. code-block:: text - =============================== test session starts ================================ - platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 - Using --randomly-seed=363797280 + ================================= test session starts =================================== + platform linux -- Python 3.13.0, pytest-8.3.3, pluggy-1.5.0 + Using --randomly-seed=1698456346 rootdir: /media/doug/warehouse/MEOPAR/SalishSeaCmd configfile: pytest.ini - plugins: cov-5.0.0, anyio-4.6.2.post1, randomly-3.15.0 + plugins: randomly-3.15.0, cov-5.0.0, anyio-4.6.2.post1 collected 327 items - tests/test_split_results.py ................ [ 4%] - tests/test_prepare.py .............. [ 9%] - tests/test_api.py ...... [ 11%] - tests/test_run.py ................................................................... - ..................................................................................... - ..................................................................................... - ............................... [ 92%] - ....................... [100%] + tests/test_api.py ...... [ 1%] + tests/test_prepare.py .............. [ 6%] + tests/test_run.py ....................................................................... + ......................................................................................... + ......................................................................................... + .......................................... [ 95%] + tests/test_split_results.py ................ [100%] - =============================== 327 passed in 2.53s ================================ + ================================= 327 passed in 0.93s =================================== You can monitor what lines of code the test suite exercises using the `coverage.py`_ and `pytest-cov`_ tools with the command: diff --git a/envs/environment-dev.yaml b/envs/environment-dev.yaml index 2b95263..4e3d28e 100644 --- a/envs/environment-dev.yaml +++ b/envs/environment-dev.yaml @@ -27,7 +27,7 @@ dependencies: - f90nml - gitpython - pip - - python=3.12 + - python=3.13 - pyyaml # For coding style, repo QA, and pkg management diff --git a/envs/environment-hpc.yaml b/envs/environment-hpc.yaml index 65eb946..caa5f19 100644 --- a/envs/environment-hpc.yaml +++ b/envs/environment-hpc.yaml @@ -19,7 +19,7 @@ dependencies: - f90nml - gitpython - pip - - python=3.12 + - python=3.13 - pyyaml - pip: diff --git a/envs/environment-rtd.yaml b/envs/environment-rtd.yaml index ed92833..b671522 100644 --- a/envs/environment-rtd.yaml +++ b/envs/environment-rtd.yaml @@ -12,7 +12,7 @@ channels: dependencies: - pip - - python=3.12 + - python=3.13 # Sphinx and extensions we use - sphinx=8.1.3 diff --git a/envs/requirements.txt b/envs/requirements.txt index 372e5c8..73e791e 100644 --- a/envs/requirements.txt +++ b/envs/requirements.txt @@ -114,6 +114,5 @@ urllib3==2.2.3 userpath==1.7.0 virtualenv==20.27.0 wcwidth==0.2.13 -wheel==0.44.0 zipp==3.20.2 zstandard==0.23.0