Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"commit": "14cbc49f79a6bba2502c8b3a593ff0babaf661ed",
"commit": "b9bacb7ddbbfaa8eff8c3e0182ebf2e8a66d00c7",
"context": {
"cookiecutter": {
"full_name": "David Huard",
Expand All @@ -22,7 +22,7 @@
"generated_with_cruft": "y",
"__gh_slug": "https://github.com/CSHS-CWRA/RavenPy",
"_template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"_commit": "14cbc49f79a6bba2502c8b3a593ff0babaf661ed"
"_commit": "b9bacb7ddbbfaa8eff8c3e0182ebf2e8a66d00c7"
}
},
"directory": null,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- CHANGELOG.rst
- CI/**.in
- CI/**.txt
- CITATION.cff
- CODE_OF_CONDUCT.md
- CONTRIBUTING.rst
- Makefile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', "macos-latest" ]
python-version: [ "3.11", "3.12", "3.13" ]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
include:
- os: 'ubuntu-latest'
python-version: '3.10'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# RAVENPY-specific
Raven_errors.txt

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
2 changes: 0 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ python:
install:
- method: pip
path: .
extra_requirements:
- docs
24 changes: 21 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,25 @@ Changelog

Contributors: Trevor James Smith (:user:`Zeitsperre`).

Changes
^^^^^^^
New features
^^^^^^^^^^^^
* `raven-hydro` minimum version updated from v0.5.0 to v4.12.1 (for more information, see: https://github.com/Ouranosinc/raven-hydro/pull/93). (PR #587)
* Dependency updates. (PR #584):

Breaking changes
^^^^^^^^^^^^^^^^
* Dependency updates. (PR #584, PR #589):
* Updated required `xskillscore` (``>= 0.0.29``) and `climpred` (``>= 2.6.0``).
* Removed version pins on `intake` and `intake-xarray`.
* Minimum required `birdy` is now ``>= 0.9.1``.
* Minimum required `pytest` is now ``>=9.0``.
* The development dependency recipes have been migrated to `dependency-groups` (PEP 735). Optional dsependency lists are now separated by features. (PR #589):
* `ravenpy[gis]`: GIS functionality.
* `ravenpy[plotting]`: Notebook interactivity.
* `ravenpy[raven-hydro]`: To compile and install the `raven-hydro` binary.
* Many unnecessary/optional dependencies have been removed from the base library requirements. (PR #589):
* `dask`, `pydap`, `typing-extensions`, `xsdba`, `xskillscore` have been removed from install requirements.
* `affine` and `setuptools` are no longer listed in `gis` recipe requirements.
* `requests` is now explicitly listed in `gis` recipe requirements.

Fixes
^^^^^
Expand All @@ -25,6 +37,12 @@ Internal changes
* Added a Makefile recipe and a GitHub Workflow to run tests against the notebooks using ``pytest --nbval`` on changes as well as on a weekly schedule. (PR #584)
* Fixed a bug in several workflows that was impeding triggers when Pull Requests are merged to `main`. (PR #584)
* The conda configurations (``environment-dev.yml`` and ``environment-docs.yml``) now specify the exact dependencies needed to run the development and documentation builds. (PR #584)
* Tests reliant on GIS libraries can now be disabled using `pytest -m "not gis"`. Many tests that were previously skipped have been re-enabled with modified assertions reflecting changes to the model expected output. (PR #589)
* The cookiecutter template has been updated. (PR #589):
* Enabled PEP 735 (`dependency-groups`) for development dependency management.
* Replaced `pre-commit` with `prek`.
* The Makefile now performs installation calls for recipes.
* `tox.toml` now uses `dependency-groups` and the new `optional-dependencies` lists for environment setup.

.. _changes_0.20.0:

Expand Down
21 changes: 15 additions & 6 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,19 @@ Ready to contribute? Here's how to set up `ravenpy` for local development.

.. code-block:: console

python -m pip install -e .[dev]
pre-commit install
python -m pip install --group dev
python -m pip install --editable .
prek install

This installs ``ravenpy`` in an "editable" state, meaning that changes to the code are immediately seen by the environment. To ensure a consistent coding style, `make dev` also installs the ``pre-commit`` hooks to your local clone.

On commit, ``pre-commit`` will check that ``flake8``, ``ruff``, ``numpydoc`` and other hooks are passing, perform automatic fixes if possible, and warn of violations that require intervention. If your commit fails the checks initially, simply fix the errors, re-add the files, and re-commit.
On commit, ``prek`` will will run ``pre-commit`` checks that ensure code quality checks are passing, perform automatic fixes if possible, and warn of violations that require intervention. If your commit fails the checks initially, simply fix the errors, re-add the files, and re-commit.

You can also run the hooks manually with:

.. code-block:: console

pre-commit run -a
prek run -a

If you want to skip the ``pre-commit`` hooks temporarily, you can pass the `--no-verify` flag to `git commit`.

Expand All @@ -134,10 +135,10 @@ Ready to contribute? Here's how to set up `ravenpy` for local development.
.. code-block:: console

git add .
git commit -m "Your detailed description of your changes."
git commit -s -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature

If ``pre-commit`` hooks fail, try fixing the issues, re-staging the files to be committed, and re-committing your changes (or, if need be, you can skip them with `git commit --no-verify`).
If ``pre-commit`` hooks fail, try fixing the issues, re-staging the files to be committed, and re-committing your changes (or, if need be, you can skip them with `--no-verify` flag).

#. Submit a `Pull Request <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>`_ through the GitHub website.

Expand Down Expand Up @@ -195,6 +196,14 @@ Before you submit a pull request, check that it meets these guidelines:

#. The pull request should work for all currently supported Python versions. Check the `pyproject.toml` or `tox.ini` files for the list of supported versions.

#. If you haven't already, ensure that you have read and agreed to the `Developer Certificate of Origin (DCO) <https://developercertificate.org/>`_, and that you have signed your commits using:

.. code-block:: bash

git commit -s/--signoff

This will add a `Signed-off-by:` line to your commit message, which indicates that you agree to the DCO.

Tips
----

Expand Down
49 changes: 33 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean clean-build clean-pyc clean-test coverage dist docs help install lint lint/flake8
.PHONY: clean clean-build clean-pyc clean-test coverage development dist docs help install lint release test
.DEFAULT_GOAL := help

define BROWSER_PYSCRIPT
Expand Down Expand Up @@ -49,27 +49,41 @@ clean-pyc: ## remove Python file artifacts
find . -name '__pycache__' -exec rm -fr {} +

clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
rm -fr .tox/
rm -fr htmlcov/

install-lint: ## install dependencies needed for linting
python -m pip install --quiet --group lint

install-docs: ## install dependencies needed for building the docs
python -m pip install --quiet --group docs

install-test: ## install dependencies needed for standard testing
python -m pip install --quiet --group test

install-tox: ## install base dependencies needed for running tox
python -m pip install --quiet --group tox

## Testing targets:

lint/flake8: ## check style with flake8
lint: install-lint ## check style
python -m ruff check src/ravenpy tests
python -m flake8 --config=.flake8 src/ravenpy tests
python -m numpydoc lint src/ravenpy/**.py
python -m vulture src/ravenpy tests
codespell src/ravenpy tests docs
python -m deptry src
python -m yamllint --config-file=.yamllint.yaml src/ravenpy

lint: lint/flake8 ## check style

test: ## run tests quickly with the default Python
test: install-test ## run tests quickly with the default Python
python -m pytest

test-all: ## run tests on every Python version with tox
test-all: install-tox ## run tests on every Python version with tox
python -m tox

coverage: ## check code coverage quickly with the default Python
coverage: install-test ## check code coverage quickly with the default Python
python -m coverage run --source src/ravenpy -m pytest
python -m coverage report -m
python -m coverage html
Expand All @@ -82,10 +96,10 @@ test-notebooks: ## test all notebooks under docs/notebooks

## Sphinx targets:

autodoc: clean-docs ## create sphinx-apidoc files
autodoc: install-docs clean-docs ## create sphinx-apidoc files
sphinx-apidoc -o docs/apidoc --private --module-first src/ravenpy

autodoc-custom-index: clean-docs ## create sphinx-apidoc files but with special index handling for indices and indicators
autodoc-custom-index: install-docs clean-docs ## create sphinx-apidoc files but with special index handling for indices and indicators
env SPHINX_APIDOC_OPTIONS="members,undoc-members,show-inheritance,noindex" sphinx-apidoc -o docs/apidoc --private --module-first src/ravenpy

linkcheck: autodoc ## run checks over all external links found throughout the documentation
Expand All @@ -96,17 +110,19 @@ initialize-translations: autodoc-custom-index ## initialize translations, ignori
sphinx-intl update -p docs/_build/gettext -d docs/locales -l fr
rm -fr docs/locales/fr/LC_MESSAGES/apidoc

docs: autodoc-custom-index ## generate Sphinx HTML documentation, including API docs
build-docs: autodoc-custom-index ## generate Sphinx HTML documentation, including API docs
$(MAKE) -C docs html BUILDDIR="_build/html/en"
ifneq ("$(wildcard $(LOCALES))","")
${MAKE} -C docs gettext
$(MAKE) -C docs html BUILDDIR="_build/html/fr" SPHINXOPTS="-D language='fr'"
endif

docs: build-docs ## open the built documentation in a web browser
ifndef READTHEDOCS
$(BROWSER) docs/_build/html/en/html/index.html
endif

servedocs: docs ## compile the docs watching for changes
servedocs: autodoc-custom-index ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

## Development targets:
Expand All @@ -121,6 +137,7 @@ release: dist ## package and upload a release
install: clean ## install the package to the active Python's site-packages
python -m pip install --no-user .

develop: clean ## install the package and development dependencies in editable mode to the active Python's site-packages
python -m pip install --no-user --editable ".[all]"
pre-commit install
development: clean ## install the package to the active Python's site-packages
python -m pip install --group dev
python -m pip install --no-user --editable .[extras]
prek install
8 changes: 6 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RavenPy |logo|
+----------------------------+-----------------------------------------------------+
| Open Source | |license| |ossf-score| |zenodo| |
+----------------------------+-----------------------------------------------------+
| Coding Standards | |ruff| |ossf-bp| |pre-commit| |
| Coding Standards | |ruff| |ossf-bp| |prek| |pre-commit-ci| |
+----------------------------+-----------------------------------------------------+
| Development Status | |status| |build| |coveralls| |
+----------------------------+-----------------------------------------------------+
Expand Down Expand Up @@ -91,10 +91,14 @@ This package was created with Cookiecutter_ and the `Ouranosinc/cookiecutter-pyp
:target: https://securityscorecards.dev/viewer/?uri=github.com/CSHS-CWRA/RavenPy
:alt: OpenSSF Scorecard

.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/CSHS-CWRA/RavenPy/master.svg
.. |pre-commit-ci| image:: https://results.pre-commit.ci/badge/github/CSHS-CWRA/RavenPy/master.svg
:target: https://results.pre-commit.ci/latest/github/CSHS-CWRA/RavenPy/master
:alt: pre-commit.ci status

.. |prek| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json
:target: https://github.com/j178/prek
:alt: prek

.. |pypi| image:: https://img.shields.io/pypi/v/RavenPy.svg
:target: https://pypi.python.org/pypi/RavenPy
:alt: PyPI
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def rebuild_readme():

# To avoid having to install these and burst memory limit on ReadTheDocs.
autodoc_mock_imports = [
"affine",
"fiona",
"geopandas",
"holoviews",
Expand Down
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ Welcome to RavenPy's documentation!

apidoc/modules

.. toctree::
:caption: GitHub Repository

CSHS-CWRA/RavenPy <https://github.com/CSHS-CWRA/RavenPy>

Indices and tables
==================
* :ref:`genindex`
Expand Down
31 changes: 16 additions & 15 deletions environment-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: ravenpy-dev
channels:
- conda-forge
- nodefaults
dependencies:
- python >=3.10,<3.15
- raven-hydro >=4.12.1,<5.0
Expand Down Expand Up @@ -31,29 +32,30 @@ dependencies:
- xskillscore >=0.0.29
- zarr
# Dev tools and testing
- pip >=25.2
- bump-my-version >=1.2.3
- click >=8.2.0
- pip >=26.0.1
- bump-my-version >=1.2.6
- click >=8.3.1
- codespell >=2.4.1
- coverage >=7.5.0
- deptry >=0.23.0
- deptry >=0.24.0
- filelock >=3.14.0
- flake8 >=7.3.0
- flake8-rst-docstrings >=0.4.0
- flit >=3.11.0,<4.0
- mypy >=1.18.2
- numpydoc >=1.9.0
- mypy >=1.19.1
- numpydoc >=1.10.0
- pooch >=1.8.0
- pre-commit >=3.5.0
- pylint >=3.3.0
- pytest >=8.2.3
- pytest-cov >=5.0.0
- prek >=0.3.0
- pylint >=4.0.4
- pytest >=9.0.2
- pytest-cov >=7.0.0
- pytest-xdist >=3.2.0
- ruff >=0.13.3
- tox >=4.30.3
- ruff >=0.15.0
- tox >=4.41.0
- tox-gh >=1.6.1
- vulture >=2.14
- watchdog >=4.0.0
- watchdog >=6.0.0
# GIS support
- affine >=2.4.0
- fiona >=1.9.0
- gdal >=3.1
- geopandas >=1.0
Expand All @@ -62,7 +64,6 @@ dependencies:
- pyproj >=3.3.0
- rasterio
- rioxarray
- setuptools >=71.0
- shapely >=2.0.0
# Notebook support
- birdy >=0.9.1
Expand Down
5 changes: 3 additions & 2 deletions environment-docs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: ravenpy-docs
channels:
- conda-forge
- nodefaults
dependencies:
- python >=3.13,<3.14
- raven-hydro >=4.12.1,<5.0
- cftime >=1.4.1
- cf-xarray >=0.9.3
- click >=8.2.0
- click >=8.3.1
- climpred >=2.6.0
- dask >=2024.8.1
- h5netcdf >=1.5.0
Expand Down Expand Up @@ -38,6 +39,6 @@ dependencies:
- sphinx >=8.2.0
- sphinx-click
- sphinx-codeautolink >=0.16.2
- sphinx-copybutton
- sphinx-copybutton >=0.5.2
- sphinx-rtd-theme >=1.0
- sphinxcontrib-svg2pdfconverter >=1.2.3
Loading
Loading