Skip to content

Commit 9dfaa9a

Browse files
authored
⬆️ UPGRADE: sphinx>=5,<8 (#148)
1 parent 9129c5e commit 9dfaa9a

File tree

4 files changed

+32
-41
lines changed

4 files changed

+32
-41
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,21 @@ jobs:
2424
tests:
2525

2626
strategy:
27+
fail-fast: false
2728
matrix:
2829
os: [ubuntu-latest]
2930
python-version: ["3.8", "3.9", "3.10", "3.11"]
31+
sphinx-version: ["~=7.0"]
3032
include:
33+
- os: ubuntu-latest
34+
python-version: 3.8
35+
sphinx-version: "~=5.0"
36+
- os: ubuntu-latest
37+
python-version: 3.8
38+
sphinx-version: "~=6.0"
3139
- os: windows-latest
3240
python-version: 3.8
41+
sphinx-version: "~=7.0"
3342

3443
runs-on: ${{ matrix.os }}
3544

@@ -43,7 +52,7 @@ jobs:
4352
- name: Install dependencies
4453
run: |
4554
python -m pip install --upgrade pip
46-
pip install -e .[testing]
55+
pip install --upgrade "sphinx${{ matrix.sphinx-version }}" -e .[testing]
4756
- name: Run pytest
4857
run: |
4958
pytest --cov=sphinx_design --cov-report=xml --cov-report=term-missing
@@ -56,29 +65,6 @@ jobs:
5665
file: ./coverage.xml
5766
fail_ci_if_error: true
5867

59-
tests-sphinx4:
60-
61-
strategy:
62-
matrix:
63-
os: [ubuntu-latest]
64-
python-version: ["3.8", "3.10"]
65-
66-
runs-on: ${{ matrix.os }}
67-
68-
steps:
69-
- uses: actions/checkout@v3
70-
- name: Set up Python ${{ matrix.python-version }}
71-
uses: actions/setup-python@v4
72-
with:
73-
python-version: ${{ matrix.python-version }}
74-
cache: pip
75-
- name: Install dependencies
76-
run: |
77-
python -m pip install --upgrade pip
78-
pip install -e .[testing] sphinx~=4.5
79-
- name: Run pytest
80-
run: pytest
81-
8268
docs-build-format:
8369

8470
runs-on: ubuntu-latest
@@ -108,7 +94,6 @@ jobs:
10894
needs:
10995
- pre-commit
11096
- tests
111-
- tests-sphinx4
11297
- docs-build-format
11398

11499
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ classifiers = [
2727
]
2828
keywords = ["sphinx", "extension", "material design", "web components"]
2929
requires-python = ">=3.8"
30-
dependencies = ["sphinx>=4,<7"]
30+
dependencies = ["sphinx>=5,<8"]
3131

3232
[project.urls]
3333
Homepage = "https://github.com/executablebooks/sphinx-design"
3434
Documentation = "https://sphinx-design.readthedocs.io"
3535

3636
[project.optional-dependencies]
3737
code_style = ["pre-commit>=2.12,<4.0"]
38-
rtd = ["myst-parser>=0.18.0,<2"]
38+
rtd = ["myst-parser>=1,<3"]
3939
testing = [
40-
"myst-parser>=0.18.0,<2",
40+
"myst-parser>=1,<3",
4141
"pytest~=7.1",
4242
"pytest-cov",
4343
"pytest-regressions",

tests/test_snippets.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ def test_snippets_rst(
3333
builder.src_path.joinpath("index.rst").write_text(content, encoding="utf8")
3434
write_assets(builder.src_path)
3535
builder.build()
36-
pformat = builder.get_doctree("index").pformat()
36+
doctree = builder.get_doctree("index", post_transforms=False)
37+
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
3738
file_regression.check(
38-
pformat,
39+
doctree.pformat(),
3940
basename=f"snippet_pre_{path.name[:-len(path.suffix)]}",
4041
extension=".xml",
4142
encoding="utf8",
@@ -56,8 +57,10 @@ def test_snippets_myst(
5657
builder.src_path.joinpath("index.md").write_text(content, encoding="utf8")
5758
write_assets(builder.src_path)
5859
builder.build()
60+
doctree = builder.get_doctree("index", post_transforms=False)
61+
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
5962
file_regression.check(
60-
builder.get_doctree("index").pformat(),
63+
doctree.pformat(),
6164
basename=f"snippet_pre_{path.name[:-len(path.suffix)]}",
6265
extension=".xml",
6366
encoding="utf8",
@@ -78,9 +81,10 @@ def test_snippets_rst_post(
7881
builder.src_path.joinpath("index.rst").write_text(content, encoding="utf8")
7982
write_assets(builder.src_path)
8083
builder.build()
81-
pformat = builder.get_doctree("index", post_transforms=True).pformat()
84+
doctree = builder.get_doctree("index", post_transforms=True)
85+
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
8286
file_regression.check(
83-
pformat,
87+
doctree.pformat(),
8488
basename=f"snippet_post_{path.name[:-len(path.suffix)]}",
8589
extension=".xml",
8690
encoding="utf8",
@@ -101,8 +105,10 @@ def test_snippets_myst_post(
101105
builder.src_path.joinpath("index.md").write_text(content, encoding="utf8")
102106
write_assets(builder.src_path)
103107
builder.build()
108+
doctree = builder.get_doctree("index", post_transforms=True)
109+
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
104110
file_regression.check(
105-
builder.get_doctree("index", post_transforms=True).pformat(),
111+
doctree.pformat(),
106112
basename=f"snippet_post_{path.name[:-len(path.suffix)]}",
107113
extension=".xml",
108114
encoding="utf8",
@@ -117,8 +123,10 @@ def test_sd_hide_title_rst(
117123
content = ":sd_hide_title:\n\nHeading\n-------\n\ncontent"
118124
builder.src_path.joinpath("index.rst").write_text(content, encoding="utf8")
119125
builder.build()
126+
doctree = builder.get_doctree("index", post_transforms=False)
127+
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
120128
file_regression.check(
121-
builder.get_doctree("index", post_transforms=False).pformat(),
129+
doctree.pformat(),
122130
basename="sd_hide_title",
123131
extension=".xml",
124132
encoding="utf8",
@@ -133,8 +141,10 @@ def test_sd_hide_title_myst(
133141
content = "---\nsd_hide_title: true\n---\n\n# Heading\n\ncontent"
134142
builder.src_path.joinpath("index.md").write_text(content, encoding="utf8")
135143
builder.build()
144+
doctree = builder.get_doctree("index", post_transforms=False)
145+
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
136146
file_regression.check(
137-
builder.get_doctree("index", post_transforms=False).pformat(),
147+
doctree.pformat(),
138148
basename="sd_hide_title",
139149
extension=".xml",
140150
encoding="utf8",

tox.ini

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ envlist = py38
99
[testenv]
1010
usedevelop = true
1111

12-
[testenv:py{37,38,39,310}]
12+
[testenv:py{38,39,310,311}]
1313
description = Run unit tests with this Python version
1414
extras =
1515
testing
16-
deps =
17-
black
18-
flake8~=3.8
19-
flake8-bugbear~=21.3
2016
commands = pytest {posargs}
2117

2218
[testenv:docs-{update,clean}-{alabaster,rtd,pydata,sbt,furo}]

0 commit comments

Comments
 (0)