Skip to content

Commit f2b4714

Browse files
👌 IMPROVE: Add support and testing for sphinx 5 (#164)
* Add testing for sphinx 5 and update dependency * Fix testing matrix for python 3.10 * Fix limit jinja2 version * Updating testing dependencies and metadata * Document custom pytest mark * Update regression outputs for sphinx text change * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Drop sphinx 4 testing * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 88a096f commit f2b4714

11 files changed

+41
-33
lines changed

‎.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
python-version: [3.6, 3.7, 3.8, 3.9]
21-
sphinx: [">=2,<3", ">=3,<4", ">=4,<5"]
22-
pygments: ["==2.8.0", "==2.9.0", "==2.10.0"]
20+
python-version: ["3.7", "3.8", "3.9", "3.10"]
21+
sphinx: [">=3,<4", ">=5,<6"]
22+
pygments: ["==2.8.0", "==2.9.0", "==2.12.0",]
2323

2424
steps:
2525
- uses: actions/checkout@v2

‎setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ def get_version():
2424
include_package_data=True,
2525
url="https://github.com/executablebooks/sphinx-tabs",
2626
license="MIT",
27-
python_requires="~=3.6",
28-
install_requires=["sphinx>=2,<5", "pygments", "docutils~=0.17.0"],
27+
python_requires="~=3.7",
28+
install_requires=["sphinx>=2,<6", "pygments", "docutils~=0.17.0", "jinja2<3.1.0"],
2929
extras_require={
3030
"testing": [
3131
"coverage",
32-
"pytest>=3.6,<4",
32+
"pytest>=7.1,<8",
3333
"pytest-cov",
3434
"pytest-regressions",
3535
"pygments",
@@ -48,9 +48,10 @@ def get_version():
4848
"License :: OSI Approved :: MIT License",
4949
"Natural Language :: English",
5050
"Operating System :: OS Independent",
51-
"Programming Language :: Python :: 3.6",
5251
"Programming Language :: Python :: 3.7",
5352
"Programming Language :: Python :: 3.8",
53+
"Programming Language :: Python :: 3.9",
54+
"Programming Language :: Python :: 3.10",
5455
"Programming Language :: Python",
5556
"Topic :: Documentation :: Sphinx",
5657
"Topic :: Documentation",

‎tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
pytest_plugins = "sphinx.testing.fixtures"
1010

1111

12+
def pytest_configure(config):
13+
config.addinivalue_line(
14+
"markers", "noautobuild: mark test to prevent autouse fixtures from running"
15+
)
16+
17+
1218
@pytest.fixture(scope="session")
1319
def rootdir():
1420
"""Pytest uses this to find test documents."""

‎tests/test_build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def test_conditional_assets(app, docname, check_asset_links):
2929
@pytest.mark.parametrize("docname", ["index", "no_tabs1", "no_tabs2"])
3030
@pytest.mark.sphinx(testroot="conditionalassets-policy")
3131
@pytest.mark.skipif(
32-
sphinx.version_info[:2] < (4, 1), reason="Test uses Sphinx 4.1 config"
32+
sphinx.version_info[:2] < (4, 1),
33+
reason="Test uses option that was introduced in Sphinx 4.1 ",
3334
)
3435
def test_conditional_assets_html_assets_policy(
3536
app,

‎tests/test_build/test_conditional_assets_html_assets_policy_index_.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<section id="fruits">
1919
<h1>
2020
Fruits
21-
<a class="headerlink" href="#fruits" title="Permalink to this headline">
21+
<a class="headerlink" href="#fruits" title="Permalink to this heading">
2222
¶
2323
</a>
2424
</h1>
@@ -54,7 +54,7 @@ <h1>
5454
<section id="luminaries">
5555
<h1>
5656
Luminaries
57-
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
57+
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
5858
¶
5959
</a>
6060
</h1>
@@ -82,7 +82,7 @@ <h1>
8282
<section id="code-tabs">
8383
<h1>
8484
Code Tabs
85-
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
85+
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
8686
¶
8787
</a>
8888
</h1>
@@ -182,7 +182,7 @@ <h1>
182182
<section id="group-tabs">
183183
<h1>
184184
Group Tabs
185-
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
185+
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
186186
¶
187187
</a>
188188
</h1>

‎tests/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<section id="fruits">
1919
<h1>
2020
Fruits
21-
<a class="headerlink" href="#fruits" title="Permalink to this headline">
21+
<a class="headerlink" href="#fruits" title="Permalink to this heading">
2222
¶
2323
</a>
2424
</h1>
@@ -54,7 +54,7 @@ <h1>
5454
<section id="luminaries">
5555
<h1>
5656
Luminaries
57-
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
57+
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
5858
¶
5959
</a>
6060
</h1>
@@ -82,7 +82,7 @@ <h1>
8282
<section id="code-tabs">
8383
<h1>
8484
Code Tabs
85-
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
85+
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
8686
¶
8787
</a>
8888
</h1>
@@ -182,7 +182,7 @@ <h1>
182182
<section id="group-tabs">
183183
<h1>
184184
Group Tabs
185-
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
185+
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
186186
¶
187187
</a>
188188
</h1>

‎tests/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<section id="fruits">
1919
<h1>
2020
Fruits
21-
<a class="headerlink" href="#fruits" title="Permalink to this headline">
21+
<a class="headerlink" href="#fruits" title="Permalink to this heading">
2222
¶
2323
</a>
2424
</h1>
@@ -54,7 +54,7 @@ <h1>
5454
<section id="luminaries">
5555
<h1>
5656
Luminaries
57-
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
57+
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
5858
¶
5959
</a>
6060
</h1>
@@ -82,7 +82,7 @@ <h1>
8282
<section id="code-tabs">
8383
<h1>
8484
Code Tabs
85-
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
85+
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
8686
¶
8787
</a>
8888
</h1>
@@ -182,7 +182,7 @@ <h1>
182182
<section id="group-tabs">
183183
<h1>
184184
Group Tabs
185-
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
185+
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
186186
¶
187187
</a>
188188
</h1>

‎tests/test_build/test_conditional_assets_index_.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<section id="fruits">
1919
<h1>
2020
Fruits
21-
<a class="headerlink" href="#fruits" title="Permalink to this headline">
21+
<a class="headerlink" href="#fruits" title="Permalink to this heading">
2222
¶
2323
</a>
2424
</h1>
@@ -54,7 +54,7 @@ <h1>
5454
<section id="luminaries">
5555
<h1>
5656
Luminaries
57-
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
57+
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
5858
¶
5959
</a>
6060
</h1>
@@ -82,7 +82,7 @@ <h1>
8282
<section id="code-tabs">
8383
<h1>
8484
Code Tabs
85-
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
85+
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
8686
¶
8787
</a>
8888
</h1>
@@ -182,7 +182,7 @@ <h1>
182182
<section id="group-tabs">
183183
<h1>
184184
Group Tabs
185-
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
185+
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
186186
¶
187187
</a>
188188
</h1>

‎tests/test_build/test_conditional_assets_no_tabs1_.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<section id="fruits">
1919
<h1>
2020
Fruits
21-
<a class="headerlink" href="#fruits" title="Permalink to this headline">
21+
<a class="headerlink" href="#fruits" title="Permalink to this heading">
2222
¶
2323
</a>
2424
</h1>
@@ -54,7 +54,7 @@ <h1>
5454
<section id="luminaries">
5555
<h1>
5656
Luminaries
57-
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
57+
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
5858
¶
5959
</a>
6060
</h1>
@@ -82,7 +82,7 @@ <h1>
8282
<section id="code-tabs">
8383
<h1>
8484
Code Tabs
85-
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
85+
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
8686
¶
8787
</a>
8888
</h1>
@@ -182,7 +182,7 @@ <h1>
182182
<section id="group-tabs">
183183
<h1>
184184
Group Tabs
185-
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
185+
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
186186
¶
187187
</a>
188188
</h1>

‎tests/test_build/test_conditional_assets_no_tabs2_.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<section id="fruits">
1919
<h1>
2020
Fruits
21-
<a class="headerlink" href="#fruits" title="Permalink to this headline">
21+
<a class="headerlink" href="#fruits" title="Permalink to this heading">
2222
¶
2323
</a>
2424
</h1>
@@ -54,7 +54,7 @@ <h1>
5454
<section id="luminaries">
5555
<h1>
5656
Luminaries
57-
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
57+
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
5858
¶
5959
</a>
6060
</h1>
@@ -82,7 +82,7 @@ <h1>
8282
<section id="code-tabs">
8383
<h1>
8484
Code Tabs
85-
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
85+
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
8686
¶
8787
</a>
8888
</h1>
@@ -182,7 +182,7 @@ <h1>
182182
<section id="group-tabs">
183183
<h1>
184184
Group Tabs
185-
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
185+
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
186186
¶
187187
</a>
188188
</h1>

‎tests/test_build/test_nested_markup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<section id="markup-in-tab-titles">
55
<h1>
66
Markup in Tab Titles
7-
<a class="headerlink" href="#markup-in-tab-titles" title="Permalink to this headline">
7+
<a class="headerlink" href="#markup-in-tab-titles" title="Permalink to this heading">
88
¶
99
</a>
1010
</h1>

0 commit comments

Comments
 (0)