Skip to content

Drop Python3.9, update several dependency pins #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
disable-sudo: true
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -64,11 +65,10 @@ jobs:
matrix:
os: [ 'ubuntu-latest' ]
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
# - "3.13"
- "3.13"
steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
Expand Down Expand Up @@ -112,14 +112,15 @@ jobs:
os: [ 'ubuntu-latest' ]
python-version:
- "3.10"
- "3.12"
- "3.13"
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
disable-sudo: true
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -141,15 +142,12 @@ jobs:
python -m pip check || true
- name: Test with pytest
run: |
python -m pytest --cov figanos
python -m pytest --cov=figanos --cov-report=lcov
- name: Report Coverage
run: |
python -m coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-conda-python${{ matrix.python-version }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
flag-name: run-{{ matrix.python-version }}-conda
parallel: true

finish:
needs:
Expand Down
29 changes: 16 additions & 13 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
Changelog
=========

..
`Unreleased <https://github.com/Ouranosinc/figanos>`_ (latest)
--------------------------------------------------------------

Contributors: Juliette Lavoie (:user:`juliettelavoie`)

Changes
^^^^^^^
* No change.

Fixes
^^^^^
* `fg.utils.get_rotpole` now accept more general inputs. (:pull:`308`).
`Unreleased <https://github.com/Ouranosinc/figanos>`_ (latest)
--------------------------------------------------------------
Contributors: Juliette Lavoie (:user:`juliettelavoie`), Trevor James Smith (:user:`Zeitsperre`).

Changes
^^^^^^^
* `figanos` now supports Python 3.13 and has dropped support for Python 3.9. (:pull:`322`).
* Several base dependencies have been updated to more modern versions. (:pull:`322`):
* `numpy` has been updated to `>=1.25.0` (no longer pinned below `2.0.0`).
* `pint` has been updated to `>=0.18.0`.
* `scikit-image` has been updated to `>=0.21.0`.
* `xarray` has been updated to `>=2023.11.0`.

Fixes
^^^^^
* `fg.utils.get_rotpole` now accept more general inputs. (:pull:`308`).

.. _changes_0.4.0:

Expand Down
34 changes: 17 additions & 17 deletions environment-dev.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
name: figanos
channels:
- conda-forge
- nodefaults
dependencies:
- python>=3.10,<3.13
- python>=3.10,<3.14
# Main
- cartopy >=0.23.0
- cairosvg >=2.6.0
- matplotlib-base >=3.6.0
- seaborn >=0.13.0
- geopandas >=1.0
- numpy >=1.23.0,<2.0.0
- numpy >=1.25.0
- pandas >=2.2.0
- platformdirs >=4.0
- pint >=0.10
- pint >=0.18
- pyyaml >=6.0.1
- scikit-image >=0.20.0
- xarray >=2022.6.0
- scikit-image >=0.21.0
- xarray >=2023.11.0
- xclim >=0.52.2
# To make the package and notebooks usable
- dask
- geoviews
- h5py
- holoviews
- netcdf4
- pooch >=1.8.0 # for xclim-testdata
- zarr >=2.13.0
# Development
- pip >=24.3.1
- pip >=25.1
- black ==25.1.0
- blackdoc ==0.3.9
- bump-my-version >=0.30.1
- bump-my-version >=1.0.0
- coverage >=7.5.0
- coveralls >=4.0.1
- flake8 >=7.1.1
- flake8-rst-docstrings >=0.3.0
- flit >=3.10.1,<4.0.0
- isort ==6.0.0
- isort ==6.0.1
- mypy >=1.14.1
- numpydoc >=1.8.0
- pre-commit >=3.5.0
Expand All @@ -44,6 +36,14 @@ dependencies:
- ruff >=0.9.0
- tox >=4.24.1
- watchdog >=4.0.0
# Notebooks
- dask
- geoviews
- h5py
- holoviews
- netcdf4
- pooch >=1.8.0 # for xclim-testdata
- zarr >=2.13.0
# Docs
- ipykernel
- ipython >=8.5.0, !=9.0.0
Expand Down
22 changes: 10 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ maintainers = [
{name = "Trevor James Smith", email = "[email protected]"}
]
readme = {file = "README.rst", content-type = "text/x-rst"}
requires-python = ">=3.9.0"
requires-python = ">=3.10.0"
keywords = ["figanos"]
license = {file = "LICENSE"}
classifiers = [
Expand All @@ -26,11 +26,10 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
# "Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython"
]
dynamic = ["description", "version"]
Expand All @@ -39,14 +38,14 @@ dependencies = [
"cairosvg >=2.6.0",
"geopandas >=1.0",
"matplotlib >=3.6.0",
"numpy >=1.23.0,<2.0.0",
"numpy >=1.25.0",
"pandas >=2.2.0",
"pint >=0.10",
"pint >=0.18",
"platformdirs >=4.0",
"pyyaml >=6.0.1",
"seaborn >=0.13.0",
"scikit-image >=0.20.0",
"xarray >=2022.6.0",
"scikit-image >=0.21.0",
"xarray >=2023.11.0",
"xclim >=0.52.2"
]

Expand All @@ -55,16 +54,15 @@ dev = [
# Dev tools and testing
"black ==25.1.0",
"blackdoc ==0.3.9",
"bump-my-version >=0.30.1",
"bump-my-version >=1.0.0",
"coverage >=7.5.0",
"coveralls >=4.0.1",
"flake8 >=7.1.0",
"flake8 >=7.1.1",
"flake8-rst-docstrings >=0.3.0",
"flit >=3.10.1,<4.0",
"isort ==6.0.1",
"mypy >=1.14.1",
"numpydoc >=1.8.0",
"pip >=24.3.1",
"pip >=25.1",
"pre-commit >=3.5.0",
"pytest >=8.3.2",
"pytest-cov >=5.0.0",
Expand All @@ -86,6 +84,7 @@ docs = [
"ipython >=8.5.0,!=9.0.0",
"jupyter_client",
"nbsphinx >=0.9.5",
"notebook",
"sphinx >=7.0.0,<8.2.0", # pinned until nbsphinx is updated to support Sphinx 8.2
"sphinx-book-theme >=1.0",
"sphinx-codeautolink",
Expand All @@ -105,7 +104,6 @@ all = ["figanos[dev]", "figanos[docs]"]

[tool.black]
target-version = [
"py39",
"py310",
"py311",
"py312",
Expand Down
9 changes: 5 additions & 4 deletions src/figanos/_testing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections.abc import Callable
from functools import wraps
from typing import IO, Callable, Optional, Union
from typing import IO

__all__ = ["pitou"]

Expand Down Expand Up @@ -32,12 +33,12 @@ def pitou():

# Overload the fetch method to add user-agent headers
@wraps(_pitou.fetch_diversion)
def _fetch(*args: str, **kwargs: Union[bool, Callable]) -> str:
def _fetch(*args: str, **kwargs: bool | Callable) -> str:
def _downloader(
url: str,
output_file: Union[str, IO],
output_file: str | IO,
poocher: pooch.Pooch,
check_only: Optional[bool] = False,
check_only: bool | None = False,
) -> None:
"""Download the file from the URL and save it to the save_path."""
headers = {"User-Agent": f"figanos ({__figanos_version__})"}
Expand Down
3 changes: 2 additions & 1 deletion src/figanos/matplotlib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import pathlib
import re
import warnings
from collections.abc import Callable
from copy import deepcopy
from tempfile import NamedTemporaryFile
from typing import Any, Callable
from typing import Any

import cairosvg
import cartopy.crs as ccrs
Expand Down
25 changes: 12 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
[tox]
min_version = 4.23.2
min_version = 4.24.1
envlist =
lint
py{39,310,311,312,313}
py{310,311,312,313}
docs
coveralls
coverage
requires =
flit >= 3.9.0,<4.0
flit >= 3.10.1,<4.0
pip >= 24.3.1
opts =
--verbose

[gh]
python =
3.9 = py39-coveralls
3.10 = py310-coveralls
3.11 = py311-coveralls
3.12 = py312-coveralls
3.10 = py310-coverage
3.11 = py311-coverage
3.12 = py312-coverage
3.13 = py313 # FIXME: no coveralls until supported

[testenv:lint]
skip_install = True
deps =
black[jupyter] ==24.10.0
black[jupyter] ==25.1.0
blackdoc ==0.3.9
isort ==5.13.2
isort ==6.0.1
flake8 >=7.1.1
ruff >=0.8.2
ruff >=0.9.0
numpydoc >=1.8.0
commands =
make lint
Expand Down Expand Up @@ -55,11 +54,11 @@ extras =
download = True
install_command = python -m pip install --no-user {opts} {packages}
deps =
coveralls: coveralls>=4.0.1
coverage: coveralls>=4.0.1
commands_pre =
pip list
pip check
commands =
pytest --cov figanos
; Coveralls requires access to a repo token set in .coveralls.yml in order to report stats
coveralls: - coveralls
coverage: - coveralls