Skip to content

Commit 0cd8c23

Browse files
authored
Merge pull request #98 from theOehrly/sphinx-v8
Allow Sphinx >=8.0 and fix deprecations; allow Python 3.12; rework test workflow
2 parents 6834615 + e5b8062 commit 0cd8c23

File tree

4 files changed

+136
-55
lines changed

4 files changed

+136
-55
lines changed

.github/workflows/build.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Tests
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
python-version:
10+
required: true
11+
type: string
12+
extra-requirements:
13+
required: false
14+
type: string
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ inputs.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ inputs.python-version }}
27+
- name: Display Python version
28+
run: python -c "import sys; print(sys.version)"
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install pytest pytest-cov codecov beautifulsoup4 ${{ inputs.extra-requirements }} -e .
33+
- name: Test with pytest
34+
run: |
35+
pytest --cov=autodocsumm --cov-report=xml tests
36+
- name: Upload codecov
37+
env:
38+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
39+
run: |
40+
codecov

.github/workflows/python-app.yml

+87-51
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,98 @@ on:
88
pull_request:
99

1010
jobs:
11-
build:
1211

13-
runs-on: ubuntu-latest
12+
build-sphinx-80plus:
13+
name: Build
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: [ "3.10", "3.11", "3.12" ]
18+
sphinx-version: [
19+
"8.0.*", "8.*" # 8.0.x and latest
20+
]
21+
uses: ./.github/workflows/build.yml
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
extra-requirements: '\
25+
"sphinx==${{ matrix.sphinx-version }}"'
26+
27+
28+
build-legacy-sphinx-45plus:
29+
name: Build
1430

1531
strategy:
32+
fail-fast: false
1633
matrix:
17-
python-version: ["3.8", "3.9"]
34+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
1835
sphinx-version: [
19-
"7.0.*", "7.1.*", "7.2.*",
20-
"6.0.*",
21-
"5.0.*",
22-
"4.5", "4.4", "4.3", "4.2", "4.1", "4.0.*",
23-
"3.5.*", "3.4.*", "3.2.*", "3.1.*", "3.0.*",
36+
"7.0.*", # possible range: 7.0.0 - 7.4.7
37+
"6.0.*", # possible range: 6.0.0 - 6.2.1
38+
"5.0.*", # possible range: 5.0.0 - 5.3.0
39+
"4.5.*" # possible range: 4.5.0, also latest that supports py3.8
2440
]
2541
include:
26-
- python-version: "3.7"
27-
sphinx-version: ""
28-
- python-version: "3.7"
29-
sphinx-version: "3.5"
30-
- python-version: "3.10"
31-
sphinx-version: ""
32-
- python-version: "3.10"
33-
sphinx-version: "4.5"
34-
- python-version: "3.11"
35-
sphinx-version: ""
36-
- python-version: "3.11"
37-
sphinx-version: "4.5"
38-
exclude:
39-
- python-version: "3.8"
40-
sphinx-version: "7.2.*"
42+
- python-version: "3.9"
43+
sphinx-version: "7.2.*" # latest version that supports py3.9
44+
uses: ./.github/workflows/build.yml
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
extra-requirements: '\
48+
"sphinx==${{ matrix.sphinx-version }}"
49+
"sphinxcontrib-applehelp<1.0.8"
50+
"sphinxcontrib-devhelp<1.0.6"
51+
"sphinxcontrib-htmlhelp<2.0.5"
52+
"sphinxcontrib-jsmath<1.0.1"
53+
"sphinxcontrib-qthelp<1.0.7"
54+
"sphinxcontrib-serializinghtml<1.1.10"'
55+
4156

42-
steps:
43-
- uses: actions/checkout@v2
44-
- name: Set up Python ${{ matrix.python-version }}
45-
uses: actions/setup-python@v2
46-
with:
47-
python-version: ${{ matrix.python-version }}
48-
- name: Display Python version
49-
run: python -c "import sys; print(sys.version)"
50-
- name: Install dependencies
51-
env:
52-
SPHINX_VERSION: ${{ matrix.sphinx-version }}
53-
run: |
54-
python -m pip install --upgrade pip
55-
SPHINX=Sphinx
56-
JINJA2=jinja2
57-
if [[ $SPHINX_VERSION != "" ]]; then
58-
SPHINX="${SPHINX}==${SPHINX_VERSION}";
59-
JINJA2="${JINJA2}<3.1";
60-
fi
61-
pip install pytest pytest-cov codecov "${SPHINX}" "${JINJA2}" beautifulsoup4 -e .
62-
- name: Test with pytest
63-
run: |
64-
pytest --cov=autodocsumm --cov-report=xml tests
65-
- name: Upload codecov
66-
env:
67-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
68-
run: |
69-
codecov
57+
build-legacy-sphinx-40plus:
58+
name: Build
59+
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
python-version: [ "3.8", "3.9" ]
64+
sphinx-version: [
65+
"4.0.*" # possible range: 4.0.0 - 4.4.0
66+
]
67+
uses: ./.github/workflows/build.yml
68+
with:
69+
python-version: ${{ matrix.python-version }}
70+
extra-requirements: '\
71+
"sphinx==${{ matrix.sphinx-version }}"
72+
"sphinxcontrib-applehelp<1.0.8"
73+
"sphinxcontrib-devhelp<1.0.6"
74+
"sphinxcontrib-htmlhelp<2.0.5"
75+
"sphinxcontrib-jsmath<1.0.1"
76+
"sphinxcontrib-qthelp<1.0.7"
77+
"sphinxcontrib-serializinghtml<1.1.10"'
78+
79+
80+
build-legacy-sphinx-30plus:
81+
name: Build
82+
83+
strategy:
84+
fail-fast: false
85+
matrix:
86+
python-version: [ "3.7", "3.8", "3.9" ]
87+
sphinx-version: [
88+
"3.0.*", # possible range: 3.0.0 - 3.5.4
89+
]
90+
include:
91+
- python-version: "3.7"
92+
sphinx-version: "3.5.*" # latest version that supports py3.7
93+
uses: ./.github/workflows/build.yml
94+
with:
95+
python-version: ${{ matrix.python-version }}
96+
extra-requirements: '\
97+
"sphinx==${{ matrix.sphinx-version }}"
98+
"jinja2<3.1"
99+
"alabaster<0.7.14"
100+
"sphinxcontrib-applehelp<1.0.8"
101+
"sphinxcontrib-devhelp<1.0.6"
102+
"sphinxcontrib-htmlhelp<2.0.5"
103+
"sphinxcontrib-jsmath<1.0.1"
104+
"sphinxcontrib-qthelp<1.0.7"
105+
"sphinxcontrib-serializinghtml<1.1.10"'

conftest.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import os.path as osp
2-
import sys
32
import pytest
3+
import sphinx
4+
import sys
5+
from packaging.version import Version
46

5-
from sphinx.testing.path import path
7+
if Version(sphinx.__version__) < Version("8.0.0"):
8+
from sphinx.testing.path import path
9+
else:
10+
from pathlib import Path as path
611

712
pytest_plugins = 'sphinx.testing.fixtures'
813

914

10-
1115
sphinx_supp = osp.abspath(osp.join(osp.dirname(__file__), "tests"))
1216

1317

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ classifiers = [
2525
'Programming Language :: Python :: 3.9',
2626
'Programming Language :: Python :: 3.10',
2727
'Programming Language :: Python :: 3.11',
28+
'Programming Language :: Python :: 3.12',
2829
'Operating System :: OS Independent',
2930
]
3031

3132
requires-python = '>= 3.7'
3233
dependencies = [
33-
'Sphinx >= 2.2, < 8.0',
34+
'Sphinx >= 2.2, < 9.0',
3435
]
3536

3637
[project.urls]

0 commit comments

Comments
 (0)