Skip to content

Commit 391a523

Browse files
authored
Merge branch 'main' into shape-specification
2 parents 301225b + a36287a commit 391a523

Some content is hidden

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

60 files changed

+2948
-671
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/*

.git-blame-ignore-revs

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

.github/dependabot.yml

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

.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+
- reopened
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

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ 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 }}
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/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

+31-58
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,117 +16,86 @@ jobs:
1216
strategy:
1317
matrix:
1418
os: [Ubuntu]
15-
python-version: ["3.7", "3.8", "3.9", "3.10"]
19+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1620
sphinx-version:
17-
["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"]
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}
1829
steps:
19-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@v4
2031

2132
- name: Python setup
22-
uses: actions/setup-python@v4
33+
uses: actions/setup-python@v5
2334
with:
2435
python-version: ${{ matrix.python-version }}
2536

2637
- name: Setup environment
2738
run: |
2839
python -m pip install --upgrade pip wheel setuptools
29-
python -m pip install -r requirements/test.txt -r doc/requirements.txt
3040
python -m pip install codecov
3141
python -m pip install ${{ matrix.sphinx-version }}
3242
python -m pip list
3343
3444
- name: Install
3545
run: |
36-
python -m pip install .
46+
python -m pip install .[test,doc]
3747
pip list
3848
3949
- name: Run test suite
4050
run: |
41-
pytest -v --pyargs .
51+
pytest -v --pyargs numpydoc
4252
4353
- name: Test coverage
4454
run: |
4555
codecov
4656
4757
- name: Make sure CLI works
4858
run: |
49-
python -m numpydoc numpydoc.tests.test_main._capture_stdout
50-
echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash
51-
python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout
52-
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
5363
5464
- name: Setup for doc build
5565
run: |
5666
sudo apt-get update
5767
sudo apt install texlive texlive-latex-extra latexmk dvipng
68+
if: runner.os == 'Linux'
5869

5970
- name: Build documentation
6071
run: |
6172
make -C doc html SPHINXOPTS="-nT"
6273
make -C doc latexpdf SPHINXOPTS="-nT"
63-
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
74+
if: runner.os == 'Linux'
10175

10276
prerelease:
10377
runs-on: ${{ matrix.os }}-latest
10478
strategy:
10579
matrix:
10680
os: [ubuntu]
107-
python-version: ["3.9", "3.10"]
81+
python-version: ["3.11", "3.12", "3.13"]
10882
steps:
109-
- uses: actions/checkout@v3
83+
- uses: actions/checkout@v4
11084

11185
- name: Python setup
112-
uses: actions/setup-python@v4
86+
uses: actions/setup-python@v5
11387
with:
11488
python-version: ${{ matrix.python-version }}
11589

11690
- name: Setup environment
11791
run: |
11892
python -m pip install --upgrade pip wheel setuptools
119-
python -m pip install --pre -r requirements/test.txt -r doc/requirements.txt
12093
python -m pip install codecov
12194
python -m pip list
12295
12396
- name: Install
12497
run: |
125-
python -m pip install .
98+
python -m pip install .[test,doc]
12699
pip list
127100
128101
- name: Run test suite
@@ -135,10 +108,10 @@ jobs:
135108
136109
- name: Make sure CLI works
137110
run: |
138-
python -m numpydoc numpydoc.tests.test_main._capture_stdout
139-
echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash
140-
python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout
141-
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
142115
143116
- name: Setup for doc build
144117
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

0 commit comments

Comments
 (0)