Skip to content

Commit 7aba71c

Browse files
committed
cookiecutter update
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
1 parent ab140df commit 7aba71c

12 files changed

Lines changed: 124 additions & 94 deletions

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
3-
"commit": "b9bacb7ddbbfaa8eff8c3e0182ebf2e8a66d00c7",
3+
"commit": "cb8b26cb78a428f6ce447a0ab1b08c0c171ad5aa",
44
"context": {
55
"cookiecutter": {
66
"full_name": "David Huard",
@@ -22,7 +22,7 @@
2222
"generated_with_cruft": "y",
2323
"__gh_slug": "https://github.com/CSHS-CWRA/RavenPy",
2424
"_template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
25-
"_commit": "b9bacb7ddbbfaa8eff8c3e0182ebf2e8a66d00c7"
25+
"_commit": "cb8b26cb78a428f6ce447a0ab1b08c0c171ad5aa"
2626
}
2727
},
2828
"directory": null,

.github/workflows/bump-version.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# - Contents: Read and Write
33
# - Metadata: Read-Only
44
# - Pull Requests: Read and Write
5+
# This workflow also requires a dedicated environment to ensure that credentials are safely accessed ("automation").
56

6-
name: "Bump Patch Version"
7+
name: "Bump Version"
78

89
on:
910
push:
@@ -42,7 +43,9 @@ permissions:
4243

4344
jobs:
4445
bump_patch_version:
46+
name: Bump build/patch version
4547
runs-on: ubuntu-latest
48+
environment: automation
4649
permissions:
4750
actions: read
4851
contents: write

.github/workflows/scorecard.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This workflow requires a dedicated environment to ensure that credentials are safely accessed ("automation").
2+
13
# This workflow uses actions that are not certified by GitHub.
24
# They are provided by a third-party and are governed by separate terms of service, privacy
35
# policy, and support documentation.
@@ -23,6 +25,7 @@ jobs:
2325
analysis:
2426
name: Scorecard analysis
2527
runs-on: ubuntu-latest
28+
environment: automation
2629
permissions:
2730
# Needed to upload the results to code-scanning dashboard.
2831
security-events: write

.github/workflows/tag-testpypi.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ jobs:
2727
persist-credentials: false
2828

2929
- name: Create Release
30-
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # 2.6.1
3130
env:
32-
# This token is provided by Actions, you do not need to create your own token
3331
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
with:
35-
tag_name: ${{ github.ref_name }}
36-
name: ${{ github.ref_name }}
37-
draft: true
38-
prerelease: false
32+
REF_NAME: ${{ github.ref_name }}
33+
run: |
34+
gh release create "$REF_NAME" \
35+
--title "$REF_NAME" \
36+
--draft \
37+
--notes ""
3938
4039
build-n-publish-testpypi:
4140
name: Build and publish Python 🐍 distributions 📦 to TestPyPI

.github/workflows/workflow-warning.yml

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -32,48 +32,60 @@ jobs:
3232
allowed-endpoints: >
3333
api.github.com:443
3434
35-
- name: Find Warning Comment
36-
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
37-
id: fc_warning
38-
with:
39-
issue-number: ${{ github.event.pull_request.number }}
40-
comment-author: 'github-actions[bot]'
41-
body-includes: |
42-
This Pull Request modifies GitHub workflows and is coming from a fork.
35+
- name: Manage Warning / Note Comments
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
APPROVED: ${{ contains(github.event.pull_request.labels.*.name, 'approved') }}
39+
PR_NUMBER: ${{ github.event.pull_request.number }}
40+
REPO: ${{ github.repository }}
41+
run: |
42+
WARNING_TEXT="This Pull Request modifies GitHub workflows and is coming from a fork."
43+
NOTE_TEXT="Workflow changes in this Pull Request have been approved!"
4344
44-
- name: Create Warning Comment
45-
if: |
46-
(steps.fc_warning.outputs.comment-id == '') &&
47-
(!contains(github.event.pull_request.labels.*.name, 'approved')) &&
48-
(github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
49-
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
50-
with:
51-
comment-id: ${{ steps.fc_warning.outputs.comment-id }}
52-
issue-number: ${{ github.event.pull_request.number }}
53-
body: |
54-
> [!WARNING]
55-
> This Pull Request modifies GitHub Workflows and is coming from a fork.
56-
**It is very important for the reviewer to ensure that the workflow changes are appropriate.**
57-
edit-mode: replace
45+
# Fetch existing comments
46+
COMMENTS=$(gh api repos/$REPO/issues/$PR_NUMBER/comments)
5847
59-
- name: Find Note Comment
60-
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
61-
id: fc_note
62-
with:
63-
issue-number: ${{ github.event.pull_request.number }}
64-
comment-author: 'github-actions[bot]'
65-
body-includes: Workflow changes in this Pull Request have been approved!
48+
# Find warning comment ID
49+
WARNING_COMMENT_ID=$(echo "$COMMENTS" | jq -r \
50+
'.[] | select(.user.login=="github-actions[bot]") | select(.body | contains("'"$WARNING_TEXT"'")) | .id' | head -n 1)
6651
67-
- name: Update Comment
68-
if: |
69-
contains(github.event.pull_request.labels.*.name, 'approved')
70-
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
71-
with:
72-
comment-id: ${{ steps.fc_note.outputs.comment-id }}
73-
issue-number: ${{ github.event.pull_request.number }}
74-
body: |
75-
> [!NOTE]
76-
> Workflow changes in this Pull Request have been approved!
77-
reactions: |
78-
hooray
79-
edit-mode: append
52+
# Find note comment ID
53+
NOTE_COMMENT_ID=$(echo "$COMMENTS" | jq -r \
54+
'.[] | select(.user.login=="github-actions[bot]") | select(.body | contains("'"$NOTE_TEXT"'")) | .id' | head -n 1)
55+
56+
if [ "$APPROVED" = "true" ]; then
57+
BODY="> [!NOTE]
58+
> Workflow changes in this Pull Request have been approved!"
59+
60+
if [ -n "$NOTE_COMMENT_ID" ] && [ "$NOTE_COMMENT_ID" != "null" ]; then
61+
# Append to existing note comment
62+
EXISTING=$(gh api repos/$REPO/issues/comments/$NOTE_COMMENT_ID --jq .body)
63+
gh api \
64+
--method PATCH \
65+
repos/$REPO/issues/comments/$NOTE_COMMENT_ID \
66+
-f body="$EXISTING
67+
68+
$BODY"
69+
else
70+
# Create new note comment
71+
gh pr comment "$PR_NUMBER" --body "$BODY"
72+
fi
73+
74+
# Add reaction (hooray)
75+
if [ -n "$NOTE_COMMENT_ID" ] && [ "$NOTE_COMMENT_ID" != "null" ]; then
76+
gh api \
77+
--method POST \
78+
repos/$REPO/issues/comments/$NOTE_COMMENT_ID/reactions \
79+
-f content='hooray' \
80+
-H "Accept: application/vnd.github+json"
81+
fi
82+
83+
else
84+
BODY="> [!WARNING]
85+
> This Pull Request modifies GitHub Workflows and is coming from a fork.
86+
**It is very important for the reviewer to ensure that the workflow changes are appropriate.**"
87+
88+
if [ -z "$WARNING_COMMENT_ID" ] || [ "$WARNING_COMMENT_ID" = "null" ]; then
89+
gh pr comment "$PR_NUMBER" --body "$BODY"
90+
fi
91+
fi

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ repos:
4949
- id: rst-inline-touching-normal
5050
- id: text-unicode-replacement-char
5151
- repo: https://github.com/astral-sh/ruff-pre-commit
52-
rev: v0.15.9
52+
rev: v0.15.10
5353
hooks:
5454
- id: ruff-check
5555
args: [ '--fix', '--show-fixes' ]
@@ -97,12 +97,12 @@ repos:
9797
- id: check-github-workflows
9898
- id: check-readthedocs
9999
- repo: https://github.com/woodruffw/zizmor-pre-commit
100-
rev: v1.23.1
100+
rev: v1.24.1
101101
hooks:
102102
- id: zizmor
103103
args: [ '--config=.zizmor.yml' ]
104104
- repo: https://github.com/gitleaks/gitleaks
105-
rev: v8.30.0
105+
rev: v8.30.1
106106
hooks:
107107
- id: gitleaks
108108
- repo: meta

.zizmor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ rules:
44
- label.yml:9
55
- first-pull-request.yml:3
66
- workflow-warning.yml:3
7+
superfluous-actions:
8+
ignore:
9+
- testdata-version.yml:69
10+
- testdata-version.yml:85

CI/requirements_ci.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
bump-my-version==1.2.6
1+
bump-my-version==1.3.0
22
deptry==0.25.1
33
exceptiongroup==1.3.1
44
flit==3.12.0
55
pip==26.0.1
66
pydantic==2.12.5
77
pylint==4.0.5
88
tomli==2.4.0
9-
tox==4.50.3
9+
tox==4.52.0
1010
tox-gh==1.7.1

CI/requirements_ci.txt

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ bracex==2.4 \
2020
--hash=sha256:a27eaf1df42cf561fed58b7a8f3fdf129d1ea16a81e1fadd1d17989bc6384beb \
2121
--hash=sha256:efdc71eff95eaff5e0f8cfebe7d01adf2c8637c8c92edaf63ef348c241a82418
2222
# via wcmatch
23-
bump-my-version==1.2.6 \
24-
--hash=sha256:1f2f0daa5d699904e9739be8efb51c4c945461bad83cd4da4c89d324d9a18343 \
25-
--hash=sha256:a2f567c10574a374b81a9bd6d2bd3cb2ca74befe5c24c3021123773635431659
26-
# via -r requirements_ci.in
23+
bump-my-version==1.3.0 \
24+
--hash=sha256:3cdaa54588d2443a29303b77e7539417187952c3d22f87bfdd32c0fe6af2f570 \
25+
--hash=sha256:5780137a8d93378af3839798fcba01c7e6cb28dcc5aa5a7ab4d8507787f1995c
26+
# via -r CI/requirements_ci.in
2727
cachetools==7.0.5 \
2828
--hash=sha256:0cd042c24377200c1dcd225f8b7b12b0ca53cc2c961b43757e774ebe190fd990 \
2929
--hash=sha256:46bc8ebefbe485407621d0a4264b23c080cedd913921bad7ac3ed2f26c183114
@@ -155,7 +155,7 @@ deptry==0.25.1 \
155155
--hash=sha256:df88952a2bab7517ef23cb304b979199b28449e5d9db2e9ba9bc27a286ac852b \
156156
--hash=sha256:e3fa3321078e11cd1ac3f10ce3ff0547731c53f9253b87c757a8749c76fe8fa9 \
157157
--hash=sha256:e6f7b8fa72932e51e86799b10dcd29381b2132dc799c790dca3b28ab08dffb28
158-
# via -r requirements_ci.in
158+
# via -r CI/requirements_ci.in
159159
dill==0.3.9 \
160160
--hash=sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a \
161161
--hash=sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c
@@ -172,7 +172,7 @@ exceptiongroup==1.3.1 \
172172
--hash=sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219 \
173173
--hash=sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598
174174
# via
175-
# -r requirements_ci.in
175+
# -r CI/requirements_ci.in
176176
# anyio
177177
filelock==3.25.2 \
178178
--hash=sha256:b64ece2b38f4ca29dd3e810287aa8c48182bbecd1ae6e9ae126c9b35f1382694 \
@@ -184,7 +184,7 @@ filelock==3.25.2 \
184184
flit==3.12.0 \
185185
--hash=sha256:1c80f34dd96992e7758b40423d2809f48f640ca285d0b7821825e50745ec3740 \
186186
--hash=sha256:2b4e7171dc22881fa6adc2dbf083e5ecc72520be3cd7587d2a803da94d6ef431
187-
# via -r requirements_ci.in
187+
# via -r CI/requirements_ci.in
188188
flit-core==3.12.0 \
189189
--hash=sha256:18f63100d6f94385c6ed57a72073443e1a71a4acb4339491615d0f16d6ff01b2 \
190190
--hash=sha256:e7a0304069ea895172e3c7bb703292e992c5d1555dd1233ab7b5621b5b69e62c
@@ -252,7 +252,7 @@ pydantic==2.12.5 \
252252
--hash=sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49 \
253253
--hash=sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d
254254
# via
255-
# -r requirements_ci.in
255+
# -r CI/requirements_ci.in
256256
# bump-my-version
257257
# pydantic-settings
258258
pydantic-core==2.41.5 \
@@ -389,15 +389,17 @@ pygments==2.20.0 \
389389
pylint==4.0.5 \
390390
--hash=sha256:00f51c9b14a3b3ae08cff6b2cdd43f28165c78b165b628692e428fb1f8dc2cf2 \
391391
--hash=sha256:8cd6a618df75deb013bd7eb98327a95f02a6fb839205a6bbf5456ef96afb317c
392-
# via -r requirements_ci.in
392+
# via -r CI/requirements_ci.in
393393
pyproject-api==1.10.0 \
394394
--hash=sha256:40c6f2d82eebdc4afee61c773ed208c04c19db4c4a60d97f8d7be3ebc0bbb330 \
395395
--hash=sha256:8757c41a79c0f4ab71b99abed52b97ecf66bd20b04fa59da43b5840bac105a09
396396
# via tox
397397
python-discovery==1.2.1 \
398398
--hash=sha256:180c4d114bff1c32462537eac5d6a332b768242b76b69c0259c7d14b1b680c9e \
399399
--hash=sha256:b6a957b24c1cd79252484d3566d1b49527581d46e789aaf43181005e56201502
400-
# via virtualenv
400+
# via
401+
# tox
402+
# virtualenv
401403
python-dotenv==1.0.1 \
402404
--hash=sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca \
403405
--hash=sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a
@@ -477,7 +479,7 @@ tomli==2.4.0 \
477479
--hash=sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa \
478480
--hash=sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087
479481
# via
480-
# -r requirements_ci.in
482+
# -r CI/requirements_ci.in
481483
# deptry
482484
# pylint
483485
# pyproject-api
@@ -494,16 +496,16 @@ tomlkit==0.13.0 \
494496
# via
495497
# bump-my-version
496498
# pylint
497-
tox==4.50.3 \
498-
--hash=sha256:5e788a512bfe6f7447e0c8d7c1b666eb2e56e5e676c65717490423bec37d1a07 \
499-
--hash=sha256:c745641de6cc4f19d066bd9f98c1c25f7affb005b381b7f3694a1f142ea0946b
499+
tox==4.52.0 \
500+
--hash=sha256:6054abf5c8b61d58776fbec991f9bf0d34bb883862beb93d2fe55601ef3977c9 \
501+
--hash=sha256:624d8ea4a8c6d5e8d168eedf0e318d736fb22e83ca83137d001ac65ffdec46fd
500502
# via
501-
# -r requirements_ci.in
503+
# -r CI/requirements_ci.in
502504
# tox-gh
503505
tox-gh==1.7.1 \
504506
--hash=sha256:4f4871ee4091b41464f2df9ab1fcedb14a48accdecbb60d53297301a9d8984c6 \
505507
--hash=sha256:a82285b16a597516f9a24f20326b124ddc7924a8b70cb05a9192e1c53d7f701d
506-
# via -r requirements_ci.in
508+
# via -r CI/requirements_ci.in
507509
types-setuptools==75.8.0.20250110 \
508510
--hash=sha256:96f7ec8bbd6e0a54ea180d66ad68ad7a1d7954e7281a710ea2de75e355545271 \
509511
--hash=sha256:a9f12980bbf9bcdc23ecd80755789085bad6bfce4060c2275bc2b4ca9f2bc480

environment-dev.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies:
1212
- climpred >=2.6.0
1313
- dask >=2024.8.1
1414
- h5netcdf >=1.3.0
15+
- h5py
1516
- haversine >=2.8.0
1617
- matplotlib-base >=3.6.0
1718
- numpy >=1.25.0
@@ -33,26 +34,26 @@ dependencies:
3334
- zarr
3435
# Dev tools and testing
3536
- pip >=26.0.1
36-
- bump-my-version >=1.2.6
37+
- bump-my-version >=1.3.0
3738
- click >=8.3.1
38-
- codespell >=2.4.1
39+
- codespell >=2.4.2
3940
- coverage >=7.5.0
40-
- deptry >=0.24.0
41+
- deptry >=0.25.1
4142
- filelock >=3.14.0
4243
- flake8 >=7.3.0
4344
- flake8-rst-docstrings >=0.4.0
4445
- flit >=3.11.0,<4.0
45-
- mypy >=1.19.1
46+
- mypy >=1.20.0
4647
- numpydoc >=1.10.0
4748
- pooch >=1.8.0
4849
- prek >=0.3.0
4950
- pylint >=4.0.4
5051
- pytest >=9.0.2
5152
- pytest-cov >=7.0.0
5253
- pytest-xdist >=3.2.0
53-
- ruff >=0.15.0
54-
- tox >=4.41.0
55-
- tox-gh >=1.6.1
54+
- ruff >=0.15.9
55+
- tox >=4.52.0
56+
- tox-gh >=1.7.1
5657
- vulture >=2.14
5758
- watchdog >=6.0.0
5859
# GIS support

0 commit comments

Comments
 (0)