Skip to content

Commit

Permalink
Update to Python 3.12 (#209)
Browse files Browse the repository at this point in the history
* Add Python 3.12 to GHA pytest-with-coverage workflow

This lets us use the workflow to test whether all the packages NEMO-Cmd depends
on have been updated to support Python 3.12.

* Add workflow_dispatch trigger to GHA CI workflow

Enables workflow to be triggered from GitHub CLI, browser, or via API.

This is primarily to allow the workflow to be run via
    gh workflow run pytest-with-coverage --ref py312
during the conda-forge Python 3.12 migration to test if the environment is
solvable yet.

* Change dev & production envs to Python 3.12

* Fix bad assertion in test_update_forecast_datasets

Bad assertion was present for some time allowing test to always pass. Upgrading
to Python 3.12 revealed it with a test failure.

* Drop Python 3.11 from GHA pytest-with-coverage workflow
  • Loading branch information
douglatornell authored Nov 10, 2023
1 parent f245a98 commit ab55391
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 101 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pytest-with-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: pytest-with-coverage
on:
push:
branches: ['*']
# Enable workflow to be triggered from GitHub CLI, browser, or via API
# primarily for testing conda env solution for new Python versions
workflow_dispatch:

jobs:
pytest-with-coverage:
Expand All @@ -12,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ '3.11' ]
python-version: [ '3.12' ]
runs-on: 'ubuntu-latest'
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sphinx-linkcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.11' ]
python-version: [ '3.12' ]
uses: UBC-MOAD/gha-workflows/.github/workflows/sphinx-linkcheck.yaml@main
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ SalishSeaNowcast
.. image:: https://img.shields.io/badge/license-Apache%202-cb2533.svg
:target: https://www.apache.org/licenses/LICENSE-2.0
:alt: Licensed under the Apache License, Version 2.0
.. image:: https://img.shields.io/badge/Python-3.11-blue?logo=python&label=Python&logoColor=gold
:target: https://docs.python.org/3.11/
.. image:: https://img.shields.io/badge/Python-3.12-blue?logo=python&label=Python&logoColor=gold
:target: https://docs.python.org/3.12/
:alt: Python Version
.. image:: https://img.shields.io/badge/version%20control-git-blue.svg?logo=github
:target: https://github.com/SalishSeaCast/SalishSeaNowcast
Expand Down
12 changes: 6 additions & 6 deletions docs/pkg_development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
.. image:: https://img.shields.io/badge/license-Apache%202-cb2533.svg
:target: https://www.apache.org/licenses/LICENSE-2.0
:alt: Licensed under the Apache License, Version 2.0
.. image:: https://img.shields.io/badge/Python-3.11-blue?logo=python&label=Python&logoColor=gold
:target: https://docs.python.org/3.11/
.. image:: https://img.shields.io/badge/Python-3.12-blue?logo=python&label=Python&logoColor=gold
:target: https://docs.python.org/3.12/
:alt: Python Version
.. image:: https://img.shields.io/badge/version%20control-git-blue.svg?logo=github
:target: https://github.com/SalishSeaCast/SalishSeaNowcast
Expand Down Expand Up @@ -71,11 +71,11 @@ The package uses the `NEMO_Nowcast`_ framework to implement the :ref:`SalishSeaN
Python Version
==============

.. image:: https://img.shields.io/badge/Python-3.11-blue?logo=python&label=Python&logoColor=gold
:target: https://docs.python.org/3.11/
.. image:: https://img.shields.io/badge/Python-3.12-blue?logo=python&label=Python&logoColor=gold
:target: https://docs.python.org/3.12/
:alt: Python Version

The :kbd:`SalishSeaNowcast` package is developed and tested using `Python`_ 3.11.
The :kbd:`SalishSeaNowcast` package is developed and tested using `Python`_ 3.12.

.. _Python: https://www.python.org/

Expand Down Expand Up @@ -431,7 +431,7 @@ The output looks something like::
(line 581) ok https://git-scm.com/
(line 262) ok https://github.com/SalishSeaCast/SalishSeaNowcast/issues/19
(line 20) ok https://img.shields.io/badge/license-Apache%202-cb2533.svg
(line 20) ok https://img.shields.io/badge/python-3.11-blue.svg
(line 20) ok https://img.shields.io/badge/python-3.12-blue.svg
(line 20) ok https://img.shields.io/badge/version%20control-git-blue.svg?logo=github
(line 20) ok https://img.shields.io/badge/code%20style-black-000000.svg
(line 20) ok https://codecov.io/gh/SalishSeaCast/SalishSeaNowcast/branch/master/graph/badge.svg
Expand Down
2 changes: 1 addition & 1 deletion envs/environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dependencies:
- pypdf2
- pyproj
- pytables
- python=3.11
- python=3.12
- pyyaml
- pyzmq
- rasterio
Expand Down
2 changes: 1 addition & 1 deletion envs/environment-fig-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies:
- pypdf2
- pyproj
- pytables
- python=3.11
- python=3.12
- pyyaml
- rasterio
- requests
Expand Down
2 changes: 1 addition & 1 deletion envs/environment-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dependencies:
- pypdf2
- pyproj
- pytables
- python=3.11
- python=3.12
- pyyaml
- pyzmq
- rasterio
Expand Down
8 changes: 2 additions & 6 deletions envs/environment-rtd.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# conda environment description file for docs build environment
# on readthedocs.org

name: sphinx-build
name: salishsea-nowcast-rtd

channels:
- conda-forge
Expand All @@ -12,16 +12,12 @@ dependencies:
- matplotlib
- pip
- pygrib
- python=3.11
- python=3.12
- retrying

# RTD packages
- mock
- pillow
- sphinx
- sphinx_rtd_theme=1.2
- sphinx-notfound-page

- pip:
# Install NEMO_Nowcast and SalishSeaNowcast packages in editable mode
- --editable git+https://github.com/43ravens/NEMO_Nowcast.git#egg=NEMO_Nowcast
Expand Down
Loading

0 comments on commit ab55391

Please sign in to comment.