-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The principle goal of this commit is to update code/tests to allow for use with sphinx 7 and upgrade to Python 3.8 - 3.11. To do this a number of other changes are made: - The development dependency configuratio, in `pyproject.toml`, is modified to use separate [extras](https://python-poetry.org/docs/pyproject/#extras) for tests, benchmarks and docs - This allows for the `docs/requirements.txt` to be removed - The noxfile now directly calls pytest/sphinx, rather than call `make`. This removes a confusing indirection, and allows for [passing arguments to sessions](https://nox.thea.codes/en/stable/config.html#passing-arguments-into-sessions) - The CI now also directly calls pytest, again removing confusing indirections - The tests are split into core and JS tests (JS were previously not actually run) - The `typing_extensions` backport for python<=3.7 is removed - The [`sphinxcontrib-jquery`](https://github.com/sphinx-contrib/jquery) dependency is added, which re-adds the jquery JavaScript removed in sphinx>=6 - This fixes the JS tests for sphinx 7
- Loading branch information
1 parent
2a97e95
commit d7ae061
Showing
27 changed files
with
1,229 additions
and
959 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,20 +13,14 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install/Update build dependencies | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade setuptools | ||
python -m pip install --upgrade pip | ||
- name: Install Poetry | ||
run: | | ||
curl -sL https://install.python-poetry.org | python - | ||
- name: Update Pip | ||
run: poetry run pip install -U pip setuptools | ||
- name: Install Nox Dependencies | ||
run: | | ||
python -m pip install poetry nox nox-poetry pyparsing==3.0.4 | ||
python -m pip install -e .[test,benchmark,docs] | ||
- name: Run Benchmark for time | ||
run: nox --non-interactive --session benchmark_time -- --full-trace | ||
run: pytest --benchmark-json output.json -k _time tests/benchmarks | ||
|
||
- name: Download previous benchmark data | ||
uses: actions/cache@v3 | ||
with: | ||
|
@@ -53,13 +47,16 @@ jobs: | |
gh-pages-branch: "benchmarks" | ||
benchmark-data-dir-path: "docs/bench" | ||
alert-comment-cc-users: '@danwos' | ||
- name: Run memory benchmark | ||
run: nox --non-interactive --session benchmark_memory | ||
|
||
- name: Run Benchmark for memory | ||
run: pytest --benchmark-json output.json -k _time tests/benchmarks | ||
- name: Create memory flamegraph | ||
run: memray flamegraph -o mem_out.html mem_out.bin | ||
- name: Publish memory flamegraph | ||
run: | | ||
git checkout benchmarks | ||
cp mem_out.html docs/memory.html | ||
git add docs/memory.html | ||
git -c "user.name=Sphinx-Needs CI" -c "[email protected]" commit -m "memory.html update" | ||
- name: Push changes | ||
run: git push origin benchmarks | ||
run: git push origin benchmarks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,97 @@ | ||
name: CI | ||
on: [pull_request] | ||
jobs: | ||
tests: | ||
name: "py${{ matrix.python-version }} sp${{ matrix.sphinx-version }} do${{ matrix.docutils-version }} ${{ matrix.os }}" | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
- uses: pre-commit/[email protected] | ||
|
||
tests-core: | ||
name: "Core py${{ matrix.python-version }} sphinx~=${{ matrix.sphinx-version }} ${{ matrix.os }}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false # Set on "false" to get the results of ALL builds | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
# 3.9.8 seems to be broken with type_ast | ||
# https://www.mail-archive.com/[email protected]/msg1829077.html | ||
python-version: ["3.8", "3.10"] | ||
sphinx-version: ['5.2.1', '4.5.0'] | ||
docutils-version: ['0.19', '0.15'] | ||
exclude: | ||
- sphinx-version: "4.5.0" | ||
docutils-version: "0.19" | ||
python-version: ["3.8", "3.11"] | ||
sphinx-version: ["5.0", "6.0", "7.0"] | ||
include: | ||
# Check only newest setups for win server | ||
- os: "windows-latest" | ||
python-version: "3.8" | ||
sphinx-version: "4.5.0" | ||
docutils-version: "0.15" | ||
sphinx-version: "5.0" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set Up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Nox Dependencies | ||
run: | | ||
python -m pip install poetry nox nox-poetry pyparsing==3.0.4 | ||
- name: Install other dependencies | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install setuptools | ||
- name: Final package list | ||
python -m pip install sphinx~=${{ matrix.sphinx-version }} -e .[test] | ||
python -m pip freeze | ||
- name: Run pytest | ||
run: | | ||
pip freeze | ||
- name: Run Tests on Windows | ||
run: nox --non-interactive --session "tests-${{ matrix.python-version }}(sphinx='${{ matrix.sphinx-version }}', docutils='${{ matrix.docutils-version }}')" -- --full-trace | ||
if: runner.os == 'Windows' | ||
|
||
- name: Run Tests on Linux | ||
run: nox --non-interactive --session "tests-${{ matrix.python-version }}(sphinx='${{ matrix.sphinx-version }}', docutils='${{ matrix.docutils-version }}')" -- --full-trace | ||
if: runner.os == 'Linux' | ||
python -m pytest -v --ignore=tests/benchmarks -m "not jstest" tests | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-20.04 | ||
tests-js: | ||
name: "JS py${{ matrix.python-version }} sphinx~=${{ matrix.sphinx-version }} ${{ matrix.os }}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: "ubuntu-latest" | ||
python-version: "3.8" | ||
sphinx-version: "5.0" | ||
- os: "ubuntu-latest" | ||
python-version: "3.11" | ||
sphinx-version: "7.0" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
- uses: pre-commit/[email protected] | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install Cypress Test Framework | ||
run: npm install cypress | ||
- name: Set Up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install sphinx~=${{ matrix.sphinx-version }} -e .[test] | ||
python -m pip freeze | ||
- name: Run pytest | ||
run: | | ||
python -m pytest -v --ignore=tests/benchmarks -m "jstest" tests | ||
check: | ||
|
||
# This job does nothing and is only used for the branch protection | ||
# see https://github.com/marketplace/actions/alls-green#why | ||
|
||
if: always() | ||
|
||
needs: | ||
- lint | ||
- tests | ||
- tests-core | ||
- tests-js | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.