Skip to content

Commit 28e66cb

Browse files
authored
Merge pull request #316 from ocefpaf/zizmor_security
Zizmor security
2 parents 43ef54c + c79cf19 commit 28e66cb

11 files changed

Lines changed: 79 additions & 35 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@ updates:
1313
github-actions:
1414
patterns:
1515
- '*'
16+
cooldown:
17+
default-days: 7
18+
19+
- package-ecosystem: "pre-commit"
20+
directory: "/"
21+
schedule:
22+
interval: "daily"
23+
labels:
24+
- "Bot"
25+
cooldown:
26+
default-days: 7

.github/workflows/deploy-docs.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Build and Deploy docs
22

3+
# no permissions by default
4+
permissions: {}
5+
36
on:
47
pull_request:
58
push:
@@ -12,15 +15,21 @@ on:
1215
jobs:
1316
build-docs:
1417
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
defaults:
21+
run:
22+
shell: bash -l {0}
1523

1624
steps:
1725
- name: checkout
18-
uses: actions/checkout@v6
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1927
with:
2028
fetch-depth: 0
29+
persist-credentials: false
2130

2231
- name: Setup Micromamba
23-
uses: mamba-org/setup-micromamba@v2
32+
uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462 # v2.0.7
2433
with:
2534
environment-name: TEST
2635
init-shell: bash
@@ -31,12 +40,10 @@ jobs:
3140
--channel conda-forge
3241
3342
- name: Install windrose
34-
shell: bash -l {0}
3543
run: |
3644
python -m pip install -e . --no-deps --force-reinstall
3745
3846
- name: Build documentation
39-
shell: bash -l {0}
4047
run: |
4148
set -e
4249
jupyter nbconvert --to notebook --execute notebooks/usage.ipynb --output=usage-output.ipynb
@@ -47,7 +54,7 @@ jobs:
4754
4855
- name: Deploy
4956
if: success() && github.event_name == 'release'
50-
uses: peaceiris/actions-gh-pages@v4
57+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
5158
with:
5259
github_token: ${{ secrets.GITHUB_TOKEN }}
5360
publish_dir: docs/_build/html

.github/workflows/pypi.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,24 @@ defaults:
1414
shell: bash
1515

1616
jobs:
17-
packages:
17+
pypi-publish:
18+
name: Upload release to PyPI
1819
runs-on: ubuntu-latest
20+
environment:
21+
name: pypi
22+
url: https://pypi.org/p/windrose
23+
permissions:
24+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
25+
1926
steps:
20-
- uses: actions/checkout@v6
27+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
# Should be enough for setuptools-scm
30+
fetch-depth: 100
31+
persist-credentials: false
2132

2233
- name: Set up Python
23-
uses: actions/setup-python@v6
34+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2435
with:
2536
python-version: "3.x"
2637

@@ -48,7 +59,4 @@ jobs:
4859
4960
- name: Publish a Python distribution to PyPI
5061
if: success() && github.event_name == 'release'
51-
uses: pypa/gh-action-pypi-publish@release/v1
52-
with:
53-
user: __token__
54-
password: ${{ secrets.PYPI_PASSWORD }}
62+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.github/workflows/tests.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Tests
22

3+
# no permissions by default
4+
permissions: {}
5+
36
on:
47
pull_request:
58
push:
@@ -10,15 +13,26 @@ jobs:
1013
runs-on: ${{ matrix.os }}
1114
strategy:
1215
matrix:
13-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
14-
os: [windows-latest, ubuntu-latest, macos-latest]
16+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
17+
os: [ ubuntu-latest ]
18+
include:
19+
- os: windows-latest
20+
python-version: "3.14"
21+
- os: macos-latest
22+
python-version: "3.14"
1523
fail-fast: false
24+
defaults:
25+
run:
26+
shell: bash -l {0}
1627

1728
steps:
18-
- uses: actions/checkout@v6
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
with:
31+
fetch-depth: 0
32+
persist-credentials: false
1933

2034
- name: Setup Micromamba for Python ${{ matrix.python-version }}
21-
uses: mamba-org/setup-micromamba@v2
35+
uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462 # v2.0.7
2236
with:
2337
environment-name: TEST
2438
init-shell: bash
@@ -29,17 +43,15 @@ jobs:
2943
--channel conda-forge
3044
3145
- name: Install windrose
32-
shell: bash -l {0}
3346
run: |
3447
python -m pip install -e . --no-deps --force-reinstall
3548
3649
- name: Tests
37-
shell: bash -l {0}
3850
run: |
3951
pytest -s -rxs -vv -Werror tests/ --mpl --mpl-generate-summary=html \
4052
--mpl-results-path="windrose_test_output-${{ matrix.os }}-${{ matrix.python-version }}"
4153
- name: Store mpl-results
42-
uses: actions/upload-artifact@v7
54+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
4355
if: failure()
4456
with:
4557
name: "windrose_test_output-${{ matrix.os }}-${{ matrix.python-version }}"

.pre-commit-config.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
files: requirements-dev.txt
1717

1818
- repo: https://github.com/psf/black-pre-commit-mirror
19-
rev: 26.1.0
19+
rev: 26.3.1
2020
hooks:
2121
- id: black
2222
language_version: python3
@@ -27,7 +27,7 @@ repos:
2727
- id: blackdoc
2828

2929
- repo: https://github.com/codespell-project/codespell
30-
rev: v2.4.1
30+
rev: v2.4.2
3131
hooks:
3232
- id: codespell
3333
exclude: >
@@ -51,12 +51,12 @@ repos:
5151
- id: add-trailing-comma
5252

5353
- repo: https://github.com/astral-sh/ruff-pre-commit
54-
rev: v0.15.4
54+
rev: v0.15.8
5555
hooks:
5656
- id: ruff
5757

5858
- repo: https://github.com/tox-dev/pyproject-fmt
59-
rev: v2.16.2
59+
rev: v2.21.0
6060
hooks:
6161
- id: pyproject-fmt
6262

@@ -80,13 +80,16 @@ repos:
8080
hooks:
8181
- id: nb-strip-paths
8282

83+
- repo: https://github.com/woodruffw/zizmor-pre-commit
84+
rev: v1.23.1
85+
hooks:
86+
- id: zizmor
87+
8388
ci:
8489
autofix_commit_msg: |
8590
[pre-commit.ci] auto fixes from pre-commit.com hooks
8691
8792
for more information, see https://pre-commit.ci
8893
autofix_prs: false
89-
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
90-
autoupdate_schedule: monthly
9194
skip: []
9295
submodules: false

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
[![License](https://img.shields.io/pypi/l/windrose.svg)](https://pypi.python.org/pypi/windrose/)
55
[![Development Status](https://img.shields.io/pypi/status/windrose.svg)](https://pypi.python.org/pypi/windrose/)
66
[![Tests](https://github.com/python-windrose/windrose/actions/workflows/tests.yml/badge.svg)](https://github.com/python-windrose/windrose/actions/workflows/tests.yml)
7-
[![DOI](https://zenodo.org/badge/37549137.svg)](https://zenodo.org/badge/latestdoi/37549137)
7+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13133010.svg)](https://doi.org/10.5281/zenodo.13133010)
88
[![JOSS](https://joss.theoj.org/papers/10.21105/joss.00268/status.svg)](https://joss.theoj.org/papers/10.21105/joss.00268)
99

10+
1011
# Windrose
1112

1213
A [wind rose](https://en.wikipedia.org/wiki/Wind_rose) is a graphic tool used by meteorologists to give a succinct view of how wind speed and direction are typically distributed at a particular location. It can also be used to describe air quality pollution sources. The wind rose tool uses Matplotlib as a backend. Data can be passed to the package using Numpy arrays or a Pandas DataFrame.

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@
161161
# (source start file, name, description, authors, manual section).
162162
man_pages = [(master_doc, "windrose", "windrose Documentation", [author], 1)]
163163

164+
# Zenodo URLs are returning 403 in the checker but are fine.
165+
linkcheck_ignore = [
166+
r"https://zenodo\.org.*",
167+
]
164168

165169
# -- Options for Texinfo output -------------------------------------------
166170

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ https://docs.github.com/en/pull-requests/collaborating-with-pull-requests
4646
:target: https://pypi.org/project/windrose/
4747
.. |Tests| image:: https://github.com/python-windrose/windrose/actions/workflows/tests.yml/badge.svg
4848
:target: https://github.com/python-windrose/windrose/actions/workflows/tests.yml
49-
.. |DOI| image:: https://zenodo.org/badge/37549137.svg
50-
:target: https://zenodo.org/badge/latestdoi/37549137
49+
.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.13133010.svg
50+
:target: https://doi.org/10.5281/zenodo.13133010
5151

5252
Indices and tables
5353
==================

docs/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Option libraries:
1313
- Pandas https://pandas.pydata.org/ (to feed plot functions easily)
1414
- SciPy https://scipy.org/ (to fit data with Weibull distribution)
1515
- ffmpeg https://www.ffmpeg.org/ (to output video)
16-
- click https://click.palletsprojects.com/ (for command line interface tools)
16+
- click https://click.palletsprojects.com/en/stable/ (for command line interface tools)
1717
- seaborn https://seaborn.pydata.org/ (for easy subplots)
1818

1919
Install latest release version via pip

notebooks/usage.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"This example use randoms values for wind speed and direction(ws and wdnotebooks/windrose_sample_poitiers_csv.ipynb\n",
1010
"variables). In situation, these variables are loaded with reals values\n",
1111
"(1-D array), from a database or directly from a text file.\n",
12-
"See [this notebook](https://github.com/python-windrose/windrose/blob/master/notebooks/windrose_sample_poitiers_csv.ipynb) for an example of real data."
12+
"See [this notebook](https://github.com/python-windrose/windrose/blob/main/notebooks/windrose_sample_poitiers_csv.ipynb) for an example of real data."
1313
]
1414
},
1515
{
@@ -452,7 +452,7 @@
452452
"source": [
453453
"Instead of using object oriented approach like previously shown, some\n",
454454
"\"shortcut\" functions have been defined: `wrbox`, `wrbar`,\n",
455-
"`wrcontour`, `wrcontourf`, `wrpdf`. See [unit tests](https://github.com/python-windrose/windrose/blob/master/tests/test_windrose.py)."
455+
"`wrcontour`, `wrcontourf`, `wrpdf`. See [unit tests](https://github.com/python-windrose/windrose/blob/main/tests/test_windrose.py)."
456456
]
457457
},
458458
{
@@ -520,7 +520,7 @@
520520
"\n",
521521
"[![Video3](http://img.youtube.com/vi/UiGC-3aw9TM/0.jpg)](https://www.youtube.com/watch?v=UiGC-3aw9TM)\n",
522522
"\n",
523-
"[Source code](https://github.com/python-windrose/windrose/blob/master/samples/example_animate.py).\n",
523+
"[Source code](https://github.com/python-windrose/windrose/blob/main/samples/example_animate.py).\n",
524524
"\n",
525525
"This is just a sample for now. API for video need to be created.\n",
526526
"\n",

0 commit comments

Comments
 (0)