Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 80 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ on:
branches: [main]

jobs:
test:
test-oldsphinx:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [Ubuntu]
python-version: ["3.10", "3.11", "3.12", "3.13"]
sphinx-version:
["sphinx==6.0", "sphinx==6.2", "sphinx==7.0", "sphinx>=7.3"]
include:
- os: Windows
python-version: "3.12"
sphinx-version: "sphinx" # version shouldn't really matter here
python-version: ["3.10", "3.11"]
sphinx-version: ["sphinx<7", "sphinx<8"]
defaults:
run:
shell: bash -eo pipefail {0}
Expand All @@ -37,7 +32,6 @@ jobs:
- name: Setup environment
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install codecov
python -m pip install "${{ matrix.sphinx-version }}"
python -m pip list

Expand All @@ -50,10 +44,6 @@ jobs:
run: |
pytest -v --pyargs numpydoc

- name: Test coverage
run: |
codecov

- name: Make sure CLI works
run: |
numpydoc render numpydoc.tests.test_main._capture_stdout
Expand All @@ -65,20 +55,66 @@ jobs:
run: |
sudo apt-get update
sudo apt install texlive texlive-latex-extra latexmk dvipng
if: runner.os == 'Linux'

- name: Build documentation
run: |
make -C doc html SPHINXOPTS="-nT"
make -C doc latexpdf SPHINXOPTS="-nT"

test:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: ["ubuntu", "macos", "windows"]
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5

- name: Python setup
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Setup environment
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip list

- name: Install
run: |
python -m pip install . --group test --group doc
pip list

- name: Run test suite
run: |
pytest -v --pyargs numpydoc

- name: Make sure CLI works
if: runner.os == 'Linux'
run: |
numpydoc render numpydoc.tests.test_main._capture_stdout
echo '! numpydoc render numpydoc.tests.test_main._invalid_docstring' | bash
numpydoc validate numpydoc.tests.test_main._capture_stdout
echo '! numpydoc validate numpydoc.tests.test_main._docstring_with_errors' | bash

- name: Setup for doc build
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y texlive texlive-latex-extra latexmk dvipng

- name: Build documentation
if: runner.os == 'Linux'
run: |
make -C doc html SPHINXOPTS="-nT"
make -C doc latexpdf SPHINXOPTS="-nT"

prerelease:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu]
python-version: ["3.11", "3.12", "3.13", "3.14"]
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5

Expand All @@ -90,7 +126,6 @@ jobs:
- name: Setup environment
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install codecov
python -m pip list

- name: Install
Expand All @@ -102,10 +137,6 @@ jobs:
run: |
pytest -v --pyargs .

- name: Test coverage
run: |
codecov

- name: Make sure CLI works
run: |
numpydoc render numpydoc.tests.test_main._capture_stdout
Expand All @@ -122,3 +153,32 @@ jobs:
run: |
make -C doc html SPHINXOPTS="-nT"
make -C doc latexpdf SPHINXOPTS="-nT"

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Python setup
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Setup environment
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install codecov
python -m pip list

- name: Install
run: |
python -m pip install --pre . --group test --group doc
pip list

- name: Run test suite
run: |
pytest -v --pyargs numpydoc

- name: Test coverage
run: |
codecov