Skip to content

Commit 2f58b6a

Browse files
authored
Support raven-hydro 0.4.0 (#459)
### What kind of change does this PR introduce? * Updates `raven-hydro` to v0.4.0 (`RavenHydroFramework` v4.0.1) * Updates and pins a few development dependencies * Adds support for Python3.13 * Adds builds for macOS to the GitHub Workflows * Unpins `netcdf4` (raises pin to v1.7.2) * Progressively drops the coveralls Python package for conda builds (unmaintained). ### Does this PR introduce a breaking change? Possibly. Behaviour of `RavenHydroFramework` may affect output values.
2 parents 1532f96 + 483a4b2 commit 2f58b6a

18 files changed

+235
-223
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ jobs:
5959
strategy:
6060
fail-fast: false
6161
matrix:
62-
os: [ 'ubuntu-latest' ] # 'macos-latest' disabled until a new build of raven-hydro is available
63-
python-version: [ "3.11", "3.12" ]
62+
os: [ 'ubuntu-latest', "macos-latest" ]
63+
python-version: [ "3.11", "3.12", "3.13" ]
6464
tox-env: [ 'false' ]
65-
# - "3.13" # not yet supported by dependencies
6665
include:
6766
- os: 'ubuntu-latest'
6867
python-version: '3.10'
@@ -98,21 +97,18 @@ jobs:
9897
python-version: ${{ matrix.python-version }}
9998
cache: pip
10099

101-
- name: Install GDAL (Ubuntu)
100+
- name: Install GDAL + Set GDAL_VERSION (Ubuntu)
102101
if: matrix.os == 'ubuntu-latest'
103102
run: |
104103
sudo apt-get update
105104
sudo apt-get install libgdal-dev
105+
echo "GDAL_VERSION=$(gdal-config --version)" >> $GITHUB_ENV
106106
- name: Install GDAL (macOS)
107107
if: matrix.os == 'macos-latest'
108108
uses: tecolicom/actions-use-homebrew-tools@b9c066b79607fa3d71e0be05d7003bb75fd9ff34 # v1.3
109109
with:
110110
tools: gdal
111111
cache: "yes"
112-
- name: Set GDAL_VERSION (Ubuntu)
113-
if: matrix.os == 'ubuntu-latest'
114-
run: |
115-
echo "GDAL_VERSION=$(gdal-config --version)" >> $GITHUB_ENV
116112
- name: Set GDAL_VERSION (macOS)
117113
if: matrix.os == 'macos-latest'
118114
run: |
@@ -125,8 +121,10 @@ jobs:
125121
run: |
126122
if [ "${{ matrix.tox-env }}" != "false" ]; then
127123
python3 -m tox -e ${{ matrix.tox-env }}
128-
else
124+
elif [ "${{ matrix.python-version }}" != "3.13" ]; then
129125
python3 -m tox -e py${{ matrix.python-version }}-coveralls
126+
else
127+
python3 -m tox -e py${{ matrix.python-version }}
130128
fi
131129
env:
132130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -142,10 +140,9 @@ jobs:
142140
strategy:
143141
fail-fast: false
144142
matrix:
145-
os: [ "ubuntu-latest" ]
146-
# - macos-latest # disabled until a new build of raven-hydro is available
143+
os: [ "ubuntu-latest", "macos-latest" ]
147144
# - windows-latest # disabled until xesmf is available
148-
python-version: [ "3.10", "3.11", "3.12" ]
145+
python-version: [ "3.10", "3.13" ]
149146
defaults:
150147
run:
151148
shell: bash -l {0}
@@ -192,15 +189,12 @@ jobs:
192189
python -m pip check || true
193190
- name: Test RavenPy
194191
run: |
195-
python -m pytest --cov --numprocesses=logical
196-
- name: Report coverage
197-
run: |
198-
python -m coveralls
199-
env:
200-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
201-
COVERALLS_FLAG_NAME: run-conda_${{ matrix.python-version }}_${{ matrix.os }}
202-
COVERALLS_PARALLEL: true
203-
COVERALLS_SERVICE_NAME: github
192+
python -m pytest --numprocesses=logical --cov=src/ravenpy --cov-report=lcov
193+
- name: Report Coverage
194+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
195+
with:
196+
flag-name: run-conda_${{ matrix.python-version }}_${{ matrix.os }}
197+
parallel: true
204198

205199
finish:
206200
needs:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ htmlcov/
4747
.coverage.*
4848
.cache
4949
nosetests.xml
50+
coverage.lcov
5051
coverage.xml
5152
*.cover
5253
.hypothesis/

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ repos:
5050
hooks:
5151
- id: isort
5252
- repo: https://github.com/astral-sh/ruff-pre-commit
53-
rev: v0.9.4
53+
rev: v0.9.6
5454
hooks:
5555
- id: ruff
5656
args: [ '--fix' ]
@@ -92,7 +92,7 @@ repos:
9292
additional_dependencies: [ 'black==25.1.0' ]
9393
- id: blackdoc-autoupdate-black
9494
- repo: https://github.com/codespell-project/codespell
95-
rev: v2.3.0
95+
rev: v2.4.1
9696
hooks:
9797
- id: codespell
9898
additional_dependencies: [ 'tomli' ]
@@ -108,7 +108,7 @@ repos:
108108
- id: check-github-workflows
109109
- id: check-readthedocs
110110
- repo: https://github.com/woodruffw/zizmor-pre-commit
111-
rev: v1.3.0
111+
rev: v1.3.1
112112
hooks:
113113
- id: zizmor
114114
args: [ '--config=.zizmor.yml' ]

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ v0.18.0 (unreleased)
1111
* Removed several `type: ignore` statements.
1212
* Spelling errors in documentation have been addressed.
1313
* Fix bug in _MonthlyRecord class definition crashing the pydantic-autodoc serialization. (PR #458)
14+
* `ravenpy` now supports Python3.13. (PR #459)
15+
* Update `raven-hydro` to v0.4.0 (`RavenHydroFramework` v4.0.1). (PR #459)
16+
* Update `xclim` to v0.54.0, `pint` to v0.24.4, and `numpy` to v1.24.0 (no longer pinned below v2.0). (PR #459)
17+
* GitHub Workflows now test `ravenpy` using macOS as well as Python3.13. (PR #459)
1418

1519
v0.17.0 (2025-01-27)
1620
--------------------

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ clean-test: ## remove test and coverage artifacts
5454
rm -fr htmlcov/
5555
rm -fr .pytest_cache
5656

57-
lint/flake8: ## check style with flake8
57+
lint/flake8: ## check style with flake8
5858
python -m ruff check src/ravenpy tests
5959
python -m flake8 --config=.flake8 src/ravenpy tests
6060
python -m numpydoc lint src/ravenpy/**.py
6161

62-
lint/black: ## check style with black
62+
lint/black: ## check style with black
6363
python -m black --check src/ravenpy tests
6464
python -m blackdoc --check src/ravenpy docs
6565
python -m isort --check src/ravenpy tests

environment-dev.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,52 @@ name: ravenpy-dev
22
channels:
33
- conda-forge
44
dependencies:
5-
- python >=3.9,<3.13
6-
- raven-hydro >=0.3.1,<1.0
7-
- libgcc # for mixing raven-hydro from PyPI with conda environments
5+
- python >=3.10,<3.14
6+
- raven-hydro >=0.4.0,<1.0
7+
# - libgcc # for mixing raven-hydro from PyPI with conda environments
88
- affine >=2.4.0
99
- cftime >=1.4.1
1010
- cf_xarray >=0.9.3
1111
- click >=8.0.0
1212
- climpred >=2.4.0
13-
- dask >=2024.4.0
13+
- dask >=2024.8.1
1414
- fiona >=1.9.0
1515
- gdal >=3.1
1616
- geopandas >=1.0
1717
- h5netcdf >=1.3.0
1818
- haversine >=2.8.0
1919
- matplotlib-base >=3.6.0
20-
- netcdf4 <=1.6.5
21-
- numpy >=1.23.0,<2.0
20+
- netcdf4 >=1.7.2
21+
- numpy >=1.24.0
2222
- owslib >=0.29.1
2323
- pandas >=2.2.0
24-
- pint >=0.20,<0.24
25-
- platformdirs
24+
- pint >=0.24.4
25+
- platformdirs >=4.3.6
2626
- pydantic >=2.0
2727
- pydap >=3.4.0
2828
- pymetalink >=6.5.2
2929
- pymbolic >=2024.2
3030
- pyproj >=3.3.0
3131
- rasterio
3232
- rioxarray
33-
- scipy >=1.10.0
33+
- scipy >=1.11.0
3434
- shapely >=2.0.0
3535
- spotpy >=1.6.1
3636
- statsmodels >=0.14.2
3737
- typing_extensions
38-
- xarray >=2023.11.0
39-
- xclim >=0.50.0
38+
- xarray >=2023.11.0,!=2024.10.0
39+
- xclim >=0.54.0
4040
- xesmf
4141
- xskillscore
4242
- zarr >=2.13,<3.0 # FIXME: zarr v3 does not support FSMap like before: https://github.com/zarr-developers/zarr-python/issues/2706
4343
# Dev tools and testing
4444
- pip >=25.0
4545
- black ==25.1.0
4646
- blackdoc ==0.3.9
47-
- bump-my-version >=0.30.1
47+
- bump-my-version >=0.32.1
4848
- click >=8.1.7
4949
- coverage >=7.5.0
50-
- coveralls >=4.0.0
51-
- filelock
50+
- filelock >=3.14.0
5251
- flake8 >=7.1.1
5352
- flake8-rst-docstrings >=0.3.0
5453
- flit >=3.10.1,<4.0
@@ -58,6 +57,7 @@ dependencies:
5857
- mypy >=1.14.1
5958
- numpydoc >=1.8.0
6059
- pre-commit >=3.5.0
60+
- pylint >=3.3.0
6161
- pytest >=8.2.2
6262
- pytest-cov >=5.0.0
6363
- pytest-xdist >=3.2.0

environment-docs.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: ravenpy-docs
22
channels:
3-
- conda-forge
4-
- defaults
3+
- conda-forge
54
dependencies:
65
- python >=3.12,<3.13
7-
- raven-hydro >=0.3.1,<1.0
8-
- autodoc-pydantic
6+
- raven-hydro >=0.4.0,<1.0
7+
- autodoc-pydantic >=2.1.0
98
- birdy
109
- cairosvg >=2.6.0
1110
- cartopy >=0.23.0
1211
- click >=8.0.0
13-
- clisops >=0.13.0
12+
- clisops >=0.15.0
1413
- gcsfs
1514
- gdal >=3.1
15+
- h5netcdf >=1.3.0
1616
# Needed for notebooks/HydroShare_integration.ipynb
1717
# See: https://github.com/CSHS-CWRA/RavenPy/pull/326
1818
# - "hsclient",
@@ -27,9 +27,9 @@ dependencies:
2727
- jupytext
2828
- matplotlib-base >=3.6.0
2929
- myst-nb
30-
- nbsphinx
31-
- netCDF4 <=1.6.5
32-
- numpy >=1.23.0,<2.0.0
30+
- nbsphinx >=0.9.5
31+
- netCDF4 >=1.7.2
32+
- numpy >=1.24.0
3333
- notebook
3434
- pydantic >=2.0
3535
- pymetalink >=6.5.2
@@ -43,6 +43,6 @@ dependencies:
4343
- sphinx-rtd-theme >=1.0
4444
- sphinxcontrib-svg2pdfconverter >=1.2.3
4545
- typing_extensions
46-
- xarray >=2023.11.0
46+
- xarray >=2023.11.0,!=2024.10.0
4747
# - xesmf # mocked
4848
- zarr >=2.13,<3.0 # FIXME: zarr v3 does not support FSMap like before: https://github.com/zarr-developers/zarr-python/issues/2706

pyproject.toml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers = [
2727
"Programming Language :: Python :: 3.10",
2828
"Programming Language :: Python :: 3.11",
2929
"Programming Language :: Python :: 3.12",
30-
# "Programming Language :: Python :: 3.13",
30+
"Programming Language :: Python :: 3.13",
3131
"Programming Language :: Python :: Implementation :: CPython",
3232
"Topic :: Scientific/Engineering :: Atmospheric Science",
3333
"Topic :: Scientific/Engineering :: GIS",
@@ -40,26 +40,25 @@ dependencies = [
4040
"cf-xarray >=0.9.3",
4141
"click >=8.0.0",
4242
"climpred >=2.4.0",
43-
"dask>=2024.4.0",
43+
"dask >=2024.8.1",
4444
"h5netcdf >=1.3.0",
4545
"haversine >=2.8.0",
4646
"matplotlib >=3.6.0",
47-
"netCDF4 <=1.6.5",
48-
"numpy >=1.23,<2.0.0",
47+
"numpy >=1.24.0",
4948
"owslib >=0.29.1",
5049
"pandas >=2.2.0",
51-
"pint >=0.20,<0.24",
52-
"platformdirs",
50+
"pint >=0.24.4",
51+
"platformdirs >=4.3.6",
5352
"pydantic >=2.0",
5453
"pydap >=3.4.0",
5554
"pymbolic >=2024.2",
56-
"raven-hydro >=0.3.1,<1.0",
57-
"scipy >=1.9.0",
55+
"raven-hydro >=0.4.0,<1.0",
56+
"scipy >=1.11.0",
5857
"spotpy >=1.6.1",
5958
"statsmodels >=0.14.2",
6059
"typing-extensions",
61-
"xarray >=2023.11.0",
62-
"xclim >=0.50.0",
60+
"xarray >=2023.11.0,!=2024.10.0",
61+
"xclim >=0.54.0",
6362
"xskillscore"
6463
]
6564

@@ -68,9 +67,9 @@ dev = [
6867
# Dev tools and testing
6968
"black ==25.1.0",
7069
"blackdoc ==0.3.9",
71-
"bump-my-version >=0.30.1",
70+
"bump-my-version >=0.32.1",
7271
"coverage >=7.5.0",
73-
"filelock",
72+
"filelock >=3.14.0",
7473
"flake8 >=7.1.1",
7574
"flake8-rst-docstrings >=0.3.0",
7675
"flit >=3.10.1,<4.0",
@@ -82,7 +81,7 @@ dev = [
8281
"numpydoc >=1.8.0",
8382
"pip >=25.0",
8483
"pre-commit >=3.5.0",
85-
"pylint",
84+
"pylint >=3.3.0",
8685
"pytest >=8.3.2",
8786
"pytest-cov >=5.0.0",
8887
"pytest-xdist >=3.2.0",
@@ -91,11 +90,11 @@ dev = [
9190
"watchdog >=4.0.0"
9291
]
9392
docs = [
94-
"autodoc-pydantic",
93+
"autodoc-pydantic >=2.1.0",
9594
"birdhouse-birdy",
9695
"cairosvg >=2.6.0",
9796
"cartopy >=0.23.0",
98-
"clisops >=0.13.0",
97+
"clisops >=0.15.0",
9998
"gcsfs",
10099
# Needed for notebooks/HydroShare_integration.ipynb
101100
# See: https://github.com/CSHS-CWRA/RavenPy/pull/326
@@ -117,13 +116,11 @@ docs = [
117116
"s3fs",
118117
"salib",
119118
"sphinx >=7.1.0",
120-
"sphinx-autoapi",
121119
"sphinx-click",
122120
"sphinx-codeautolink >=0.16.2",
123121
"sphinx-copybutton",
124122
"sphinx-rtd-theme >=1.0",
125123
"sphinxcontrib-svg2pdfconverter >=1.2.3",
126-
"typing-extensions",
127124
"xesmf",
128125
"zarr >=2.10.0,<3.0" # FIXME: zarr v3 does not support FSMap like before: https://github.com/zarr-developers/zarr-python/issues/2706
129126
]
@@ -133,6 +130,7 @@ gis = [
133130
"geopandas >=1.0",
134131
"gdal >=3.1",
135132
"lxml",
133+
"netcdf4 >=1.7.2",
136134
"pyproj >=3.3.0",
137135
"rasterio",
138136
"rioxarray",
@@ -325,23 +323,31 @@ warn_required_dynamic_aliases = true
325323
warn_untyped_fields = true
326324

327325
[tool.pytest.ini_options]
326+
minversion = "7.0"
328327
addopts = [
329328
"--verbose",
330329
"--color=yes",
330+
"--strict-config",
331331
"--strict-markers",
332332
"--tb=native",
333333
"--numprocesses=0",
334334
"--maxprocesses=8",
335335
"--dist=worksteal"
336336
]
337337
python_files = "test_*.py"
338-
norecursedirs = ["src", ".git", "bin"]
338+
norecursedirs = ["docs/notebooks"]
339339
filterwarnings = ["ignore::UserWarning"]
340-
testpaths = "tests"
340+
testpaths = [
341+
"tests"
342+
]
343+
pythonpath = [
344+
"src"
345+
]
341346
markers = [
342347
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
343348
"online: mark tests that require external services (deselect with '-m \"not online\"')"
344349
]
350+
xfail_strict = true
345351

346352
[tool.ruff]
347353
src = ["ravenpy"]

0 commit comments

Comments
 (0)