Skip to content

Commit c40b210

Browse files
committed
Merge remote-tracking branch 'upstream' into ConstructorChecking_ASTValidator
2 parents 9f70d0f + eb831f4 commit c40b210

File tree

17 files changed

+122
-114
lines changed

17 files changed

+122
-114
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
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: scientific-python/circleci-artifacts-redirector-action@7eafdb60666f57706a5525a2f5eb76224dc8779b # v1.1.0
8+
uses: scientific-python/circleci-artifacts-redirector-action@5d358ff96e96429a5c64a969bb4a574555439f4f # v1.3.1
99
with:
1010
repo-token: ${{ secrets.GITHUB_TOKEN }}
1111
api-token: ${{ secrets.CIRCLECI_ARTIFACT_REDIRECTOR_TOKEN }}

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
name: sdist and wheels
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
15+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1616
with:
1717
fetch-depth: 0
18-
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
18+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
1919
with:
2020
python-version: "3.12"
2121
- name: Build wheels
@@ -24,7 +24,7 @@ jobs:
2424
pip install -U build twine wheel
2525
python -m build --sdist --wheel
2626
- run: twine check --strict dist/*
27-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
27+
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
2828
with:
2929
name: dist
3030
path: dist
@@ -40,8 +40,8 @@ jobs:
4040
# IMPORTANT: this permission is mandatory for trusted publishing
4141
id-token: write
4242
steps:
43-
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
43+
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
4444
with:
4545
name: dist
4646
path: dist
47-
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
47+
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.github/workflows/test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [Ubuntu]
19-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
19+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2020
sphinx-version:
2121
["sphinx==6.0", "sphinx==6.2", "sphinx==7.0", "sphinx>=7.3"]
2222
include:
@@ -27,10 +27,10 @@ jobs:
2727
run:
2828
shell: bash -eo pipefail {0}
2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
3131

3232
- name: Python setup
33-
uses: actions/setup-python@v5
33+
uses: actions/setup-python@v6
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636

@@ -79,12 +79,12 @@ jobs:
7979
strategy:
8080
matrix:
8181
os: [ubuntu]
82-
python-version: ["3.11", "3.12", "3.13"]
82+
python-version: ["3.11", "3.12", "3.13", "3.14"]
8383
steps:
84-
- uses: actions/checkout@v4
84+
- uses: actions/checkout@v5
8585

8686
- name: Python setup
87-
uses: actions/setup-python@v5
87+
uses: actions/setup-python@v6
8888
with:
8989
python-version: ${{ matrix.python-version }}
9090

@@ -96,7 +96,7 @@ jobs:
9696
9797
- name: Install
9898
run: |
99-
python -m pip install . --pre --group test --group doc
99+
python -m pip install --pre . --group test --group doc
100100
pip list
101101
102102
- name: Run test suite

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
6+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
77
hooks:
88
- id: check-added-large-files
99
- id: check-ast
@@ -25,7 +25,7 @@ repos:
2525
args: [--prose-wrap=preserve]
2626

2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: "971923581912ef60a6b70dbf0c3e9a39563c9d47" # frozen: v0.11.4
28+
rev: "9c89adb347f6b973f4905a4be0051eb2ecf85dea" # frozen: v0.13.3
2929
hooks:
3030
- id: ruff
3131
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ docstrings formatted according to the NumPy documentation format.
1717
The extension also adds the code description directives
1818
``np:function``, ``np-c:function``, etc.
1919

20-
numpydoc requires Python 3.9+ and sphinx 6+.
20+
numpydoc requires Python 3.10+ and sphinx 6+.
2121

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

doc/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Getting started
55
Installation
66
============
77

8-
This extension requires Python 3.9+, sphinx 6+ and is available from:
8+
This extension requires Python 3.10+, sphinx 6+ and is available from:
99

1010
* `numpydoc on PyPI <http://pypi.python.org/pypi/numpydoc>`_
1111
* `numpydoc on GitHub <https://github.com/numpy/numpydoc/>`_

numpydoc/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
import ast
55
from collections.abc import Sequence
66
from pathlib import Path
7-
from typing import List, Union
7+
from typing import List
88

99
from .docscrape_sphinx import get_doc_object
1010
from .hooks import utils, validate_docstrings
1111
from .validate import ERROR_MSGS, Validator, validate
1212

1313

14-
def render_object(import_path: str, config: Union[List[str], None] = None) -> int:
14+
def render_object(import_path: str, config: List[str] | None = None) -> int:
1515
"""Test numpydoc docstring generation for a given object."""
1616
# TODO: Move Validator._load_obj to a better place than validate
1717
print(get_doc_object(Validator._load_obj(import_path), config=dict(config or [])))
@@ -117,7 +117,7 @@ def _parse_config(s):
117117
return ap
118118

119119

120-
def main(argv: Union[Sequence[str], None] = None) -> int:
120+
def main(argv: Sequence[str] | None = None) -> int:
121121
"""CLI for numpydoc."""
122122
ap = get_parser()
123123

numpydoc/docscrape.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def get_func(self):
597597
def __str__(self):
598598
out = ""
599599

600-
func, func_name = self.get_func()
600+
_func, func_name = self.get_func()
601601

602602
roles = {"func": "function", "meth": "method"}
603603

@@ -701,7 +701,7 @@ def properties(self):
701701
and not self._should_skip_member(name, self._cls)
702702
and (
703703
func is None
704-
or isinstance(func, (property, cached_property))
704+
or isinstance(func, property | cached_property)
705705
or inspect.isdatadescriptor(func)
706706
)
707707
and self._is_show_member(name)

numpydoc/docscrape_sphinx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def load_config(self, config):
3737
self.template = template_env.get_template("numpydoc_docstring.rst")
3838

3939
# string conversion routines
40-
def _str_header(self, name, symbol="`"):
40+
def _str_header(self, name):
4141
return [".. rubric:: " + name, ""]
4242

4343
def _str_field_list(self, name):

numpydoc/hooks/validate_docstrings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def name(self) -> str:
6363

6464
@property
6565
def is_function_or_method(self) -> bool:
66-
return isinstance(self.node, (ast.FunctionDef, ast.AsyncFunctionDef))
66+
return isinstance(self.node, ast.FunctionDef | ast.AsyncFunctionDef)
6767

6868
@property
6969
def is_mod(self) -> bool:
@@ -236,7 +236,7 @@ def visit(self, node: ast.AST) -> None:
236236
The node to visit.
237237
"""
238238
if isinstance(
239-
node, (ast.Module, ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef)
239+
node, ast.Module | ast.ClassDef | ast.FunctionDef | ast.AsyncFunctionDef
240240
):
241241
self.stack.append(node)
242242

@@ -395,8 +395,8 @@ def process_file(filepath: os.PathLike, config: dict) -> "list[list[str]]":
395395
def run_hook(
396396
files: List[str],
397397
*,
398-
config: Union[Dict[str, Any], None] = None,
399-
ignore: Union[List[str], None] = None,
398+
config: Dict[str, Any] | None = None,
399+
ignore: List[str] | None = None,
400400
) -> int:
401401
"""
402402
Run the numpydoc validation hook.

0 commit comments

Comments
 (0)