Skip to content

Commit df1c230

Browse files
authored
Merge branch 'main' into keyword-only-parameters
2 parents d51e929 + 4cfcfa6 commit df1c230

Some content is hidden

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

44 files changed

+2005
-316
lines changed

.circleci/config.yml

+19-11
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,47 @@ version: 2
22
jobs:
33
build_docs:
44
docker:
5-
- image: circleci/python:3.7-stretch
5+
- image: "cimg/python:3.11"
66
steps:
77
- checkout
88
- run:
9-
name: Set BASH_ENV
10-
command: |
11-
echo "set -e" >> $BASH_ENV;
12-
echo "export PATH=~/.local/bin:$PATH" >> $BASH_ENV;
13-
sudo apt update
14-
sudo apt install dvipng texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-generic-extra latexmk texlive-xetex
9+
name: Update apt-get
10+
command: sudo apt-get update
11+
- run:
12+
name: Install TeX
13+
command: sudo apt install dvipng texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra latexmk texlive-xetex
1514
- restore_cache:
1615
keys:
1716
- pip-cache
1817
- run:
1918
name: Get dependencies and install
2019
command: |
21-
pip install --user -q --upgrade pip setuptools
22-
pip install --user -q --upgrade numpy matplotlib sphinx pydata-sphinx-theme
23-
pip install --user -e .
20+
python3 -m venv venv
21+
source venv/bin/activate
22+
python -m pip install --upgrade pip wheel setuptools
23+
python -m pip install --upgrade -r requirements/doc.txt
24+
python -m pip list
2425
- save_cache:
2526
key: pip-cache
2627
paths:
2728
- ~/.cache/pip
2829
- run:
29-
name: make html
30+
name: Install
31+
command: |
32+
source venv/bin/activate
33+
pip install -e .
34+
- run:
35+
name: Build docs
3036
command: |
37+
source venv/bin/activate
3138
make -C doc html
3239
- store_artifacts:
3340
path: doc/_build/html/
3441
destination: html
3542
- run:
3643
name: make tinybuild
3744
command: |
45+
source venv/bin/activate
3846
make -C numpydoc/tests/tinybuild html
3947
- store_artifacts:
4048
path: numpydoc/tests/tinybuild/_build/html/

.coveragerc

-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
branch = True
33
source = numpydoc
44
omit =
5-
*/setup.py
65
numpydoc/tests/*
76
numpydoc/templates/*

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
labels:
8+
- "type: Maintenance"

.github/workflows/label-check.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Labels
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- repoened
8+
- labeled
9+
- unlabeled
10+
- synchronize
11+
12+
env:
13+
LABELS: ${{ join( github.event.pull_request.labels.*.name, ' ' ) }}
14+
15+
jobs:
16+
check-type-label:
17+
name: ensure type label
18+
runs-on: ubuntu-latest
19+
steps:
20+
- if: "contains( env.LABELS, 'type: ' ) == false"
21+
run: exit 1

.github/workflows/lint.yml

-12
This file was deleted.

.github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ jobs:
88
uses: larsoner/circleci-artifacts-redirector-action@master
99
with:
1010
repo-token: ${{ secrets.GITHUB_TOKEN }}
11+
api-token: ${{ secrets.CIRCLECI_ARTIFACT_REDIRECTOR_TOKEN }}
1112
artifact-path: 0/html/index.html
1213
circleci-jobs: build_docs
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Milestone
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
branches:
8+
- "main"
9+
10+
jobs:
11+
milestone_pr:
12+
name: attach to PR
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: scientific-python/attach-next-milestone-action@bc07be829f693829263e57d5e8489f4e57d3d420
16+
with:
17+
token: ${{ secrets.MILESTONE_LABELER_TOKEN }}
18+
force: true

.github/workflows/test.yml

+17-45
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: numpydoc tests
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
5+
cancel-in-progress: true
6+
37
on:
48
push:
59
branches: [main]
@@ -12,11 +16,17 @@ jobs:
1216
strategy:
1317
matrix:
1418
os: [Ubuntu]
15-
python-version: ["3.7", "3.8", "3.9", "3.10"]
19+
python-version: ["3.8", "3.9", "3.10", "3.11"]
1620
sphinx-version:
17-
["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"]
21+
[
22+
"sphinx==5.0",
23+
"sphinx==5.3",
24+
"sphinx==6.0",
25+
"sphinx==6.2",
26+
"sphinx>=7.0",
27+
]
1828
steps:
19-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
2030

2131
- name: Python setup
2232
uses: actions/setup-python@v4
@@ -26,7 +36,7 @@ jobs:
2636
- name: Setup environment
2737
run: |
2838
python -m pip install --upgrade pip wheel setuptools
29-
python -m pip install -r requirements/test.txt -r doc/requirements.txt
39+
python -m pip install -r requirements/test.txt -r requirements/doc.txt
3040
python -m pip install codecov
3141
python -m pip install ${{ matrix.sphinx-version }}
3242
python -m pip list
@@ -38,7 +48,7 @@ jobs:
3848
3949
- name: Run test suite
4050
run: |
41-
pytest -v --pyargs .
51+
pytest -v --pyargs numpydoc
4252
4353
- name: Test coverage
4454
run: |
@@ -61,52 +71,14 @@ jobs:
6171
make -C doc html SPHINXOPTS="-nT"
6272
make -C doc latexpdf SPHINXOPTS="-nT"
6373
64-
base:
65-
runs-on: ${{ matrix.os }}-latest
66-
strategy:
67-
matrix:
68-
os: [ubuntu, macos, windows]
69-
python-version: ["3.11-dev"]
70-
sphinx-version:
71-
["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"]
72-
steps:
73-
- uses: actions/checkout@v3
74-
75-
- name: Python setup
76-
uses: actions/setup-python@v4
77-
with:
78-
python-version: ${{ matrix.python-version }}
79-
80-
- name: Setup environment
81-
run: |
82-
python -m pip install --upgrade pip wheel setuptools
83-
python -m pip install pytest pytest-cov
84-
python -m pip install ${{ matrix.sphinx-version }}
85-
python -m pip list
86-
87-
- name: Install
88-
run: |
89-
python -m pip install .
90-
pip list
91-
92-
- name: Run test suite
93-
run: pytest -v --pyargs numpydoc
94-
95-
- name: Make sure CLI works
96-
run: |
97-
python -m numpydoc numpydoc.tests.test_main._capture_stdout
98-
echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash
99-
python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout
100-
echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash
101-
10274
prerelease:
10375
runs-on: ${{ matrix.os }}-latest
10476
strategy:
10577
matrix:
10678
os: [ubuntu]
10779
python-version: ["3.9", "3.10"]
10880
steps:
109-
- uses: actions/checkout@v3
81+
- uses: actions/checkout@v4
11082

11183
- name: Python setup
11284
uses: actions/setup-python@v4
@@ -116,7 +88,7 @@ jobs:
11688
- name: Setup environment
11789
run: |
11890
python -m pip install --upgrade pip wheel setuptools
119-
python -m pip install --pre -r requirements/test.txt -r doc/requirements.txt
91+
python -m pip install --pre -r requirements/test.txt -r requirements/doc.txt
12092
python -m pip install codecov
12193
python -m pip list
12294

.pre-commit-config.yaml

+25-7
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: v4.3.0
6+
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
77
hooks:
88
- id: trailing-whitespace
99
- id: end-of-file-fixer
@@ -17,24 +17,42 @@ repos:
1717
- id: check-added-large-files
1818

1919
- repo: https://github.com/psf/black
20-
rev: 22.6.0
20+
rev: 2a1c67e0b2f81df602ec1f6e7aeb030b9709dc7c # frozen: 23.11.0
2121
hooks:
2222
- id: black
2323

2424
- repo: https://github.com/pre-commit/mirrors-prettier
25-
rev: v2.7.1
25+
rev: 1bedde25f5cae9b6e8799b161ccc3ab401f421bd # frozen: v4.0.0-alpha.3
2626
hooks:
2727
- id: prettier
28+
entry: env PRETTIER_LEGACY_CLI=1 prettier # temporary fix for https://github.com/prettier/prettier/issues/15742
2829
files: \.(html|md|yml|yaml)
2930
args: [--prose-wrap=preserve]
3031

31-
- repo: https://github.com/asottile/blacken-docs
32-
rev: v1.12.1
32+
- repo: https://github.com/adamchainz/blacken-docs
33+
rev: 960ead214cd1184149d366c6d27ca6c369ce46b6 # frozen: 1.16.0
3334
hooks:
3435
- id: blacken-docs
3536

3637
- repo: https://github.com/asottile/pyupgrade
37-
rev: v2.37.1
38+
rev: 1bbebc88c6925a4e56fd5446b830b12c38c1c24a # frozen: v3.15.0
3839
hooks:
3940
- id: pyupgrade
40-
args: [--py37-plus]
41+
args: [--py38-plus]
42+
43+
- repo: local
44+
hooks:
45+
- id: generate_requirements.py
46+
name: generate_requirements.py
47+
language: system
48+
entry: python tools/generate_requirements.py
49+
files: "pyproject.toml|requirements/.*\\.txt|tools/generate_requirements.py"
50+
51+
ci:
52+
# This ensures that pr's aren't autofixed by the bot, rather you call
53+
# the bot to make the fix
54+
autofix_prs: false
55+
autofix_commit_msg: |
56+
'[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

.pre-commit-hooks.yaml

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

.readthedocs.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.11"
12+
# You can also specify other tool versions:
13+
# nodejs: "19"
14+
# rust: "1.64"
15+
# golang: "1.19"
16+
17+
# Build documentation in the "doc/" directory with Sphinx
18+
sphinx:
19+
configuration: doc/conf.py
20+
21+
# Optionally build your docs in additional formats such as PDF and ePub
22+
# formats:
23+
# - pdf
24+
# - epub
25+
26+
# Optional but recommended, declare the Python requirements required
27+
# to build your documentation
28+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
29+
python:
30+
install:
31+
- method: pip
32+
path: .
33+
extra_requirements:
34+
- doc

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2008-2022 Stefan van der Walt <stefan@mentat.za.net>, Pauli Virtanen <pav@iki.fi>
1+
Copyright (C) 2008-2023 Stefan van der Walt <stefan@mentat.za.net>, Pauli Virtanen <pav@iki.fi>
22

33
Redistribution and use in source and binary forms, with or without
44
modification, are permitted provided that the following conditions are

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ docstrings formatted according to the NumPy documentation format.
1818
The extension also adds the code description directives
1919
``np:function``, ``np-c:function``, etc.
2020

21-
numpydoc requires Python 3.7+ and sphinx 4.2+.
21+
numpydoc requires Python 3.8+ and sphinx 5+.
2222

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

RELEASE.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Process
4646
- Publish on PyPi::
4747

4848
git clean -fxd
49-
pip install build wheel twine
49+
pip install --upgrade build wheel twine
5050
python -m build --sdist --wheel
5151
twine upload -s dist/*
5252

0 commit comments

Comments
 (0)