Skip to content

Commit 1019f79

Browse files
authored
Merge branch 'main' into keyword-only-parameters
2 parents df1c230 + a36287a commit 1019f79

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1232
-644
lines changed

.git-blame-ignore-revs

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
4b38c01e680cf2032acb09819bc0985e5dfc5ca8
2+
be316333f436519e0e2ab1379cbdedde79c9ac68

.github/dependabot.yml

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ updates:
66
interval: "monthly"
77
labels:
88
- "type: Maintenance"
9+
groups:
10+
actions:
11+
patterns:
12+
- "*"

.github/workflows/label-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
types:
66
- opened
7-
- repoened
7+
- reopened
88
- labeled
99
- unlabeled
1010
- synchronize

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: Run CircleCI artifacts redirector
66
steps:
77
- name: GitHub Action step
8-
uses: larsoner/circleci-artifacts-redirector-action@master
8+
uses: scientific-python/circleci-artifacts-redirector-action@4e13a10d89177f4bfc8007a7064bdbeda848d8d1 # v1.0.0
99
with:
1010
repo-token: ${{ secrets.GITHUB_TOKEN }}
1111
api-token: ${{ secrets.CIRCLECI_ARTIFACT_REDIRECTOR_TOKEN }}

.github/workflows/release.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build Wheel and Release
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
tags:
8+
- v*
9+
10+
jobs:
11+
sdist_wheel:
12+
name: sdist and wheels
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
19+
with:
20+
python-version: "3.12"
21+
- name: Build wheels
22+
run: |
23+
git clean -fxd
24+
pip install -U build twine wheel
25+
python -m build --sdist --wheel
26+
- run: twine check --strict dist/*
27+
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
28+
with:
29+
name: dist
30+
path: dist
31+
32+
pypi-publish:
33+
needs: sdist_wheel
34+
name: upload release to PyPI
35+
if: github.repository_owner == 'numpy' && startsWith(github.ref, 'refs/tags/v') && github.actor == 'jarrodmillman' && always()
36+
runs-on: ubuntu-latest
37+
# Specifying a GitHub environment is optional, but strongly encouraged
38+
environment: release
39+
permissions:
40+
# IMPORTANT: this permission is mandatory for trusted publishing
41+
id-token: write
42+
steps:
43+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
44+
with:
45+
name: dist
46+
path: dist
47+
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4

.github/workflows/test.yml

+24-23
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,34 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [Ubuntu]
19-
python-version: ["3.8", "3.9", "3.10", "3.11"]
19+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2020
sphinx-version:
21-
[
22-
"sphinx==5.0",
23-
"sphinx==5.3",
24-
"sphinx==6.0",
25-
"sphinx==6.2",
26-
"sphinx>=7.0",
27-
]
21+
["sphinx==6.0", "sphinx==6.2", "sphinx==7.0", "sphinx>=7.3"]
22+
include:
23+
- os: Windows
24+
python-version: "3.12"
25+
sphinx-version: "sphinx" # version shouldn't really matter here
26+
defaults:
27+
run:
28+
shell: bash -eo pipefail {0}
2829
steps:
2930
- uses: actions/checkout@v4
3031

3132
- name: Python setup
32-
uses: actions/setup-python@v4
33+
uses: actions/setup-python@v5
3334
with:
3435
python-version: ${{ matrix.python-version }}
3536

3637
- name: Setup environment
3738
run: |
3839
python -m pip install --upgrade pip wheel setuptools
39-
python -m pip install -r requirements/test.txt -r requirements/doc.txt
4040
python -m pip install codecov
4141
python -m pip install ${{ matrix.sphinx-version }}
4242
python -m pip list
4343
4444
- name: Install
4545
run: |
46-
python -m pip install .
46+
python -m pip install .[test,doc]
4747
pip list
4848
4949
- name: Run test suite
@@ -56,45 +56,46 @@ jobs:
5656
5757
- name: Make sure CLI works
5858
run: |
59-
python -m numpydoc numpydoc.tests.test_main._capture_stdout
60-
echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash
61-
python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout
62-
echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash
59+
numpydoc render numpydoc.tests.test_main._capture_stdout
60+
echo '! numpydoc render numpydoc.tests.test_main._invalid_docstring' | bash
61+
numpydoc validate numpydoc.tests.test_main._capture_stdout
62+
echo '! numpydoc validate numpydoc.tests.test_main._docstring_with_errors' | bash
6363
6464
- name: Setup for doc build
6565
run: |
6666
sudo apt-get update
6767
sudo apt install texlive texlive-latex-extra latexmk dvipng
68+
if: runner.os == 'Linux'
6869

6970
- name: Build documentation
7071
run: |
7172
make -C doc html SPHINXOPTS="-nT"
7273
make -C doc latexpdf SPHINXOPTS="-nT"
74+
if: runner.os == 'Linux'
7375

7476
prerelease:
7577
runs-on: ${{ matrix.os }}-latest
7678
strategy:
7779
matrix:
7880
os: [ubuntu]
79-
python-version: ["3.9", "3.10"]
81+
python-version: ["3.11", "3.12", "3.13"]
8082
steps:
8183
- uses: actions/checkout@v4
8284

8385
- name: Python setup
84-
uses: actions/setup-python@v4
86+
uses: actions/setup-python@v5
8587
with:
8688
python-version: ${{ matrix.python-version }}
8789

8890
- name: Setup environment
8991
run: |
9092
python -m pip install --upgrade pip wheel setuptools
91-
python -m pip install --pre -r requirements/test.txt -r requirements/doc.txt
9293
python -m pip install codecov
9394
python -m pip list
9495
9596
- name: Install
9697
run: |
97-
python -m pip install .
98+
python -m pip install .[test,doc]
9899
pip list
99100
100101
- name: Run test suite
@@ -107,10 +108,10 @@ jobs:
107108
108109
- name: Make sure CLI works
109110
run: |
110-
python -m numpydoc numpydoc.tests.test_main._capture_stdout
111-
echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash
112-
python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout
113-
echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash
111+
numpydoc render numpydoc.tests.test_main._capture_stdout
112+
echo '! numpydoc render numpydoc.tests.test_main._invalid_docstring' | bash
113+
numpydoc validate numpydoc.tests.test_main._capture_stdout
114+
echo '! numpydoc validate numpydoc.tests.test_main._docstring_with_errors' | bash
114115
115116
- name: Setup for doc build
116117
run: |

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ doc/_build
1616
numpydoc/tests/tinybuild/_build
1717
numpydoc/tests/tinybuild/generated
1818
MANIFEST
19+
node_modules

.pre-commit-config.yaml

+17-29
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,33 @@
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
6+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
77
hooks:
8-
- id: trailing-whitespace
9-
- id: end-of-file-fixer
10-
- id: debug-statements
8+
- id: check-added-large-files
119
- id: check-ast
12-
- id: mixed-line-ending
13-
- id: check-yaml
14-
args: [--allow-multiple-documents]
10+
- id: check-case-conflict
1511
- id: check-json
1612
- id: check-toml
17-
- id: check-added-large-files
18-
19-
- repo: https://github.com/psf/black
20-
rev: 2a1c67e0b2f81df602ec1f6e7aeb030b9709dc7c # frozen: 23.11.0
21-
hooks:
22-
- id: black
13+
- id: check-yaml
14+
args: [--allow-multiple-documents]
15+
- id: debug-statements
16+
- id: end-of-file-fixer
17+
- id: mixed-line-ending
18+
- id: trailing-whitespace
2319

2420
- repo: https://github.com/pre-commit/mirrors-prettier
25-
rev: 1bedde25f5cae9b6e8799b161ccc3ab401f421bd # frozen: v4.0.0-alpha.3
21+
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
2622
hooks:
2723
- id: prettier
28-
entry: env PRETTIER_LEGACY_CLI=1 prettier # temporary fix for https://github.com/prettier/prettier/issues/15742
29-
files: \.(html|md|yml|yaml)
24+
types_or: [yaml, toml, markdown, css, scss, javascript, json]
3025
args: [--prose-wrap=preserve]
3126

32-
- repo: https://github.com/adamchainz/blacken-docs
33-
rev: 960ead214cd1184149d366c6d27ca6c369ce46b6 # frozen: 1.16.0
34-
hooks:
35-
- id: blacken-docs
36-
37-
- repo: https://github.com/asottile/pyupgrade
38-
rev: 1bbebc88c6925a4e56fd5446b830b12c38c1c24a # frozen: v3.15.0
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: "89c421dff2e1026ba12cdb9ebd731f4a83aa8021" # frozen: v0.8.6
3929
hooks:
40-
- id: pyupgrade
41-
args: [--py38-plus]
30+
- id: ruff
31+
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
32+
- id: ruff-format
4233

4334
- repo: local
4435
hooks:
@@ -49,10 +40,7 @@ repos:
4940
files: "pyproject.toml|requirements/.*\\.txt|tools/generate_requirements.py"
5041

5142
ci:
52-
# This ensures that pr's aren't autofixed by the bot, rather you call
53-
# the bot to make the fix
5443
autofix_prs: false
5544
autofix_commit_msg: |
5645
'[pre-commit.ci 🤖] Apply code format tools to PR'
57-
# Update hook versions every month (so we don't get hit with weekly update pr's)
58-
autoupdate_schedule: monthly
46+
autoupdate_schedule: quarterly

.pre-commit-hooks.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- id: numpydoc-validation
22
name: numpydoc-validation
33
description: This hook validates that docstrings in committed files adhere to numpydoc standards.
4-
entry: validate-docstrings
5-
require_serial: true
4+
entry: numpydoc lint
5+
require_serial: false
66
language: python
77
types: [python]

.readthedocs.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ version: 2
66

77
# Set the OS, Python version and other tools you might need
88
build:
9-
os: ubuntu-22.04
9+
os: ubuntu-24.04
1010
tools:
11-
python: "3.11"
11+
python: "3.13"
1212
# You can also specify other tool versions:
1313
# nodejs: "19"
1414
# rust: "1.64"

README.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ numpydoc -- Numpy's Sphinx extensions
44

55
.. image:: https://readthedocs.org/projects/numpydoc/badge/?version=latest
66
:alt: Documentation Status
7-
:scale: 100%
87
:target: https://numpydoc.readthedocs.io/en/latest/
98

109
.. image:: https://codecov.io/gh/numpy/numpydoc/branch/main/graph/badge.svg
@@ -18,7 +17,7 @@ docstrings formatted according to the NumPy documentation format.
1817
The extension also adds the code description directives
1918
``np:function``, ``np-c:function``, etc.
2019

21-
numpydoc requires Python 3.8+ and sphinx 5+.
20+
numpydoc requires Python 3.9+ and sphinx 6+.
2221

2322
For usage information, please refer to the `documentation
2423
<https://numpydoc.readthedocs.io/>`_.

RELEASE.rst

+29-15
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,41 @@ Introduction
66

77
Example ``__version__``
88

9-
- 1.8.dev0 # development version of 1.8 (release candidate 1)
10-
- 1.8rc1 # 1.8 release candidate 1
11-
- 1.8rc2.dev0 # development version of 1.8 (release candidate 2)
9+
- 1.8rc0.dev0 # development version of 1.8 (first release candidate)
10+
- 1.8rc0 # 1.8 release candidate 1
11+
- 1.8rc1.dev0 # development version of 1.8 (second release candidate)
1212
- 1.8 # 1.8 release
13-
- 1.9.dev0 # development version of 1.9 (release candidate 1)
13+
- 1.9rc0.dev0 # development version of 1.9 (first release candidate)
1414

1515
Test release candidates on numpy, scipy, matplotlib, scikit-image, and networkx.
1616

1717
Process
1818
-------
1919

20-
- Review and update ``doc/release_notes.rst``.
20+
- Set release variables::
21+
22+
export VERSION=<version number>
23+
export PREVIOUS=<previous version number>
24+
export ORG="numpy"
25+
export REPO="numpydoc"
26+
export LOG="doc/release/notes.rst"
27+
28+
- Autogenerate release notes::
29+
30+
changelist ${ORG}/${REPO} v${PREVIOUS} main --version ${VERSION} --config pyproject.toml --format rst --out ${VERSION}.rst
31+
changelist ${ORG}/${REPO} v${PREVIOUS} main --version ${VERSION} --config pyproject.toml --out ${VERSION}.md
32+
cat ${VERSION}.rst | cat - ${LOG} > temp && mv temp ${LOG} && rm ${VERSION}.rst
2133

2234
- Update ``__version__`` in ``numpydoc/_version.py``.
2335

2436
- Commit changes::
2537

26-
git add numpydoc/_version.py doc/release_notes.rst
27-
git commit -m 'Designate <version> release'
38+
git add numpydoc/_version.py ${LOG}
39+
git commit -m "Designate ${VERSION} release"
2840

2941
- Add the version number (e.g., `v1.2.0`) as a tag in git::
3042

31-
git tag -s [-u <key-id>] v<version> -m 'signed <version> tag'
43+
git tag -s v${VERSION} -m "signed ${VERSION} tag"
3244

3345
If you do not have a gpg key, use -u instead; it is important for
3446
Debian packaging that the tags are annotated
@@ -39,16 +51,18 @@ Process
3951

4052
where ``origin`` is the name of the ``github.com:numpy/numpydoc`` repository
4153

42-
- Review the github release page::
54+
- Create release from tag::
55+
56+
- go to https://github.com/numpy/numpydoc/releases/new?tag=v${VERSION}
57+
- add v${VERSION} for the `Release title`
58+
- paste contents (or upload) of ${VERSION}.md in the `Describe this release section`
59+
- if pre-release check the box labelled `Set as a pre-release`
4360

44-
https://github.com/numpy/numpydoc/releases
4561

46-
- Publish on PyPi::
62+
- Update https://github.com/numpy/numpydoc/milestones::
4763

48-
git clean -fxd
49-
pip install --upgrade build wheel twine
50-
python -m build --sdist --wheel
51-
twine upload -s dist/*
64+
- close old milestone
65+
- ensure new milestone exists (perhaps setting due date)
5266

5367
- Update ``__version__`` in ``numpydoc/_version.py``.
5468

0 commit comments

Comments
 (0)