Skip to content

Commit 5c80225

Browse files
authored
Merge pull request numpy#27294 from mattip/circleci-spin
BUILD: refactor circleci to use spin [skip actions][skip azp][skip cirrus]
2 parents 5f5d678 + bebd7e0 commit 5c80225

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

.circleci/config.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,22 @@ jobs:
5454
command: |
5555
python3.11 -m venv venv
5656
. venv/bin/activate
57-
pip install --progress-bar=off -r requirements/test_requirements.txt
57+
pip install --progress-bar=off -r requirements/test_requirements.txt \
58+
-r requirements/build_requirements.txt \
59+
-r requirements/ci_requirements.txt
5860
# get newer, pre-release versions of critical packages
5961
pip install --progress-bar=off --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple -r requirements/doc_requirements.txt
6062
# then install numpy HEAD, which will override the version installed above
61-
pip install . --config-settings=setup-args="-Dallow-noblas=true"
62-
63-
- run:
64-
name: create release notes
65-
command: |
66-
. venv/bin/activate
67-
VERSION=$(pip show numpy | grep Version: | cut -d ' ' -f 2 | cut -c 1-5)
68-
towncrier build --version $VERSION --yes
69-
./tools/ci/test_all_newsfragments_used.py
63+
spin build --with-scipy-openblas=64
7064
7165
- run:
7266
name: build devdocs w/ref warnings
7367
command: |
7468
. venv/bin/activate
75-
cd doc
7669
# Don't use -q, show warning summary"
77-
SPHINXOPTS="-W -n" make -e html
78-
if [[ $(find build/html -type f | wc -l) -lt 1000 ]]; then
79-
echo "doc build failed: build/html is empty"
70+
SPHINXOPTS="-W -n" spin docs
71+
if [[ $(find doc/build/html -type f | wc -l) -lt 1000 ]]; then
72+
echo "doc build failed: doc/build/html is empty"
8073
exit -1
8174
fi
8275
@@ -95,9 +88,16 @@ jobs:
9588
# destination: neps
9689

9790
- run:
98-
name: run refguide-check
91+
name: check doctests
9992
command: |
10093
. venv/bin/activate
94+
spin check-docs -v
95+
spin check-tutorials -v
96+
# Currently, this does two checks not done by check-docs:
97+
# - validates ReST blocks (via validate_rst_syntax)
98+
# - checks that all of a module's `__all__` is reflected in the
99+
# module-level docstring autosummary
100+
echo calling python tools/refguide_check.py -v
101101
python tools/refguide_check.py -v
102102
103103
- persist_to_workspace:

.spin/cmds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,14 @@ def check_docs(ctx, pytest_args, n_jobs, verbose, *args, **kwargs):
367367
def check_tutorials(ctx, pytest_args, n_jobs, verbose, *args, **kwargs):
368368
"""🔧 Run doctests of user-facing rst tutorials.
369369
370-
To test all tutorials in the numpy/doc/source/user/ directory, use
370+
To test all tutorials in the numpy doc/source/user/ directory, use
371371
372372
spin check-tutorials
373373
374374
To run tests on a specific RST file:
375375
376376
\b
377-
spin check-tutorials numpy/doc/source/user/absolute-beginners.rst
377+
spin check-tutorials doc/source/user/absolute-beginners.rst
378378
379379
\b
380380
Note:
@@ -391,11 +391,11 @@ def check_tutorials(ctx, pytest_args, n_jobs, verbose, *args, **kwargs):
391391
# - `spin check-tutorials path/to/rst`, and
392392
# - `spin check-tutorials path/to/rst -- --durations=3`
393393
if (not pytest_args) or all(arg.startswith('-') for arg in pytest_args):
394-
pytest_args = ('numpy/doc/source/user',) + pytest_args
394+
pytest_args = ('doc/source/user',) + pytest_args
395395

396396
# make all paths relative to the numpy source folder
397397
pytest_args = tuple(
398-
str(curdir / '..' / '..' / arg) if not arg.startswith('-') else arg
398+
str(curdir / '..' / arg) if not arg.startswith('-') else arg
399399
for arg in pytest_args
400400
)
401401

requirements/doc_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ pickleshare
1616
# needed to build release notes
1717
towncrier
1818
toml
19+
20+
# for doctests, also needs pytz which is in test_requirements
21+
scipy-doctest

0 commit comments

Comments
 (0)