Skip to content

Commit

Permalink
Update cookiecutter, fix test data URL (#282)
Browse files Browse the repository at this point in the history
### What kind of change does this PR introduce?

* Updates the cookiecutter template to the latest version
* Sets some base versions for some unpinned libraries
* Adjusts the default URL in `pitou` to use the `main` branch

### Does this PR introduce a breaking change?

Not really. Fixes some broken functionality.
  • Loading branch information
Zeitsperre authored Dec 12, 2024
2 parents 8d4c3b4 + 15a0cc6 commit d6171c3
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"commit": "f750ad2185cbb56df6f7e98a269bdd8399283ea8",
"commit": "b27c2d5f8126ea1aefae29a6f5ccfdafad96395d",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cache-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
actions: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand All @@ -30,4 +30,4 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Dependency Review
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
2 changes: 1 addition & 1 deletion .github/workflows/first-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- "3.x"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout Repository
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
# - "3.13"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout Repository
Expand Down Expand Up @@ -108,27 +108,24 @@ jobs:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@617811f69075e3fd3ae68ca64220ad065877f246 # v2.0.0
uses: mamba-org/setup-micromamba@06375d89d211a1232ef63355742e9e2e564bc7f7 # v2.0.2
with:
cache-downloads: true
environment-file: environment-dev.yml
create-args: >-
python=${{ matrix.python-version }}
- name: Micromamba version
run: |
echo "micromamba $(micromamba --version)"
- name: Install figanos
run: |
python -m pip install --no-deps .
- name: Check versions
run: |
conda list
micromamba list
python -m pip check || true
- name: Test with pytest
run: |
Expand All @@ -149,7 +146,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: audit
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand All @@ -41,4 +41,4 @@ jobs:
run: |
python -m flit build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa # v1.11.0
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tag-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Create Release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # 2.0.8
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # 2.1.0
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -48,7 +48,7 @@ jobs:
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout Repository
Expand All @@ -64,7 +64,7 @@ jobs:
run: |
python -m flit build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa # v1.11.0
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
2 changes: 1 addition & 1 deletion .github/workflows/workflow-warning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: check-yaml
args: [ '--allow-multiple-documents' ]
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
rev: v0.24.2
hooks:
- id: toml-sort-fix
- repo: https://github.com/pre-commit/pygrep-hooks
Expand Down Expand Up @@ -82,7 +82,7 @@ repos:
- id: numpydoc-validation
exclude: ^docs/|^tests/
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.30.0
hooks:
- id: check-github-workflows
- id: check-readthedocs
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ Internal changes
* Several development dependencies have been updated to their latest versions.
* Updated the GitHub Actions in Workflows to their latest versions.
* The documentation has been adapted to use the latest testing data fetching mechanism from `xclim`. (:pull:`273`).
* Updated the `cookiecutter` template to the latest version. Dependencies and GitHub Actions have been updated. (:pull:`282`).

Bug fixes
^^^^^^^^^
* Creating the colormap in `fg.matplotlib.scattermap` is now done like `fg.matplotlib.gridmap` (:pull:`238`, :issue:`239`).
* Updated the default testing data URL in the `pitou` function to point to the correct branch. (:pull:`282`).

0.3.0 (2024-02-16)
------------------
Expand Down
10 changes: 5 additions & 5 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ dependencies:
- python>=3.9,<3.13
# Main
- cartopy >=0.23.0
- cairosvg
- cairosvg >=2.6.0
- matplotlib-base >=3.6.0
- seaborn
- seaborn >=0.13.0
- geopandas >=1.0
- numpy >=1.23.0,<2.0.0
- pandas >=2.2.0
- platformdirs
- pint >=0.10,<0.24
- pyyaml >=6.0.1
- scikit-image
- scikit-image >=0.20.0
- xarray >=2022.6.0
- xclim >=0.52.2
# To make the package and notebooks usable
Expand All @@ -27,6 +27,7 @@ dependencies:
- pooch >=1.8.0 # for xclim-testdata
- zarr >=2.13.0
# Development
- pip >=24.3.1
- black ==24.10.0
- blackdoc ==0.3.9
- bump-my-version >=0.28.0
Expand All @@ -38,11 +39,10 @@ dependencies:
- isort ==5.13.2
- mypy
- numpydoc >=1.8.0
- pip >=24.3.1
- pre-commit >=3.5.0
- pytest >=8.3.2
- pytest-cov >=5.0.0
- ruff >=0.7.0
- ruff >=0.8.2
- tox >=4.23.2
- watchdog >=4.0.0
# Docs
Expand Down
31 changes: 15 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,41 @@ classifiers = [
dynamic = ["description", "version"]
dependencies = [
"cartopy >=0.23.0",
"cairosvg",
"cairosvg >=2.6.0",
"geopandas >=1.0",
"matplotlib >=3.6.0",
"numpy >=1.23.0,<2.0.0",
"pandas >=2.2.0",
"pint >=0.10,<0.24",
"platformdirs",
"pyyaml >=6.0.1",
"seaborn",
"scikit-image",
"seaborn >=0.13.0",
"scikit-image >=0.20.0",
"xarray >=2022.6.0",
"xclim >=0.52.2"
]

[project.optional-dependencies]
dev = [
# Dev tools and testing
"pip >=24.3.1",
"black ==24.10.0",
"blackdoc ==0.3.9",
"bump-my-version >=0.28.0",
"watchdog >=4.0.0",
"coverage >=7.5.0",
"coveralls >=4.0.1",
"flake8 >=7.1.0",
"flake8-alphabetize >=0.0.21",
"flake8-rst-docstrings >=0.3.0",
"flit >=3.9.0,<4.0",
"tox >=4.23.2",
"coverage >=7.5.0",
"coveralls >=4.0.1",
"isort ==5.13.2",
"mypy",
"numpydoc >=1.8.0",
"pip >=24.3.1",
"pre-commit >=3.5.0",
"pytest >=8.3.2",
"pytest-cov >=5.0.0",
"black ==24.10.0",
"blackdoc ==0.3.9",
"isort ==5.13.2",
"ruff >=0.7.0",
"pre-commit >=3.5.0"
"ruff >=0.8.2",
"tox >=4.23.2",
"watchdog >=4.0.0"
]
docs = [
# To make the package and notebooks usable
Expand All @@ -87,11 +86,11 @@ docs = [
"ipython >=8.5.0",
"jupyter_client",
"nbsphinx",
"sphinx >=7.0.0",
"sphinx-book-theme >=1.0",
"sphinx-codeautolink",
"sphinx-copybutton",
"sphinx-intl",
"sphinx >=7.0.0",
"sphinxcontrib-napoleon"
]
all = ["figanos[dev]", "figanos[docs]"]
Expand Down Expand Up @@ -234,7 +233,7 @@ py_version = 39

[tool.mypy]
files = "."
python_version = 3.8
python_version = 3.9
show_error_codes = true
strict = true
warn_no_return = true
Expand Down
3 changes: 1 addition & 2 deletions src/figanos/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def pitou():

_pitou = pooch.Pooch(
path=pooch.os_cache("figanos"),
# base_url="https://raw.githubusercontent.com/Ouranosinc/figanos/main/src/figanos/data/test_data/",
base_url="https://raw.githubusercontent.com/Ouranosinc/figanos/split-doc/src/figanos/data/test_data/",
base_url="https://raw.githubusercontent.com/Ouranosinc/figanos/main/src/figanos/data/test_data/",
registry={
"hatchmap-ens_stats.nc": "fc52d0551747fa0a7153f1ecfebf3e697993590c6c7c4c6a6f9f32700df9d32d",
"hatchmap-inf_5.nc": "8f22522dc153d8d347bdf97bf85e49d08a5ecbc61c64372e713a0d25638e48ac",
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ deps =
blackdoc ==0.3.9
isort ==5.13.2
flake8 >=7.1.1
ruff >=0.7.0
ruff >=0.8.2
numpydoc >=1.8.0
commands =
make lint
Expand All @@ -37,6 +37,7 @@ allowlist_externals =
extras =
docs
commands =
make autodoc
make --directory=docs clean html
allowlist_externals =
make
Expand Down

0 comments on commit d6171c3

Please sign in to comment.