Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👌 IMPROVE: Add support and testing for sphinx 5 #164

Merged
merged 11 commits into from
Jun 25, 2022
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
sphinx: [">=2,<3", ">=3,<4", ">=4,<5"]
pygments: ["==2.8.0", "==2.9.0", "==2.10.0"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
sphinx: [">=3,<4", ">=5,<6"]
pygments: ["==2.8.0", "==2.9.0", "==2.12.0",]

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def get_version():
include_package_data=True,
url="https://github.com/executablebooks/sphinx-tabs",
license="MIT",
python_requires="~=3.6",
install_requires=["sphinx>=2,<5", "pygments", "docutils~=0.17.0"],
python_requires="~=3.7",
install_requires=["sphinx>=2,<6", "pygments", "docutils~=0.17.0", "jinja2<3.1.0"],
extras_require={
"testing": [
"coverage",
"pytest>=3.6,<4",
"pytest>=7.1,<8",
"pytest-cov",
"pytest-regressions",
"pygments",
Expand All @@ -48,9 +48,10 @@ def get_version():
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python",
"Topic :: Documentation :: Sphinx",
"Topic :: Documentation",
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
pytest_plugins = "sphinx.testing.fixtures"


def pytest_configure(config):
config.addinivalue_line(
"markers", "noautobuild: mark test to prevent autouse fixtures from running"
)


@pytest.fixture(scope="session")
def rootdir():
"""Pytest uses this to find test documents."""
Expand Down
3 changes: 2 additions & 1 deletion tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def test_conditional_assets(app, docname, check_asset_links):
@pytest.mark.parametrize("docname", ["index", "no_tabs1", "no_tabs2"])
@pytest.mark.sphinx(testroot="conditionalassets-policy")
@pytest.mark.skipif(
sphinx.version_info[:2] < (4, 1), reason="Test uses Sphinx 4.1 config"
sphinx.version_info[:2] < (4, 1),
reason="Test uses option that was introduced in Sphinx 4.1 ",
)
def test_conditional_assets_html_assets_policy(
app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<section id="fruits">
<h1>
Fruits
<a class="headerlink" href="#fruits" title="Permalink to this headline">
<a class="headerlink" href="#fruits" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -54,7 +54,7 @@ <h1>
<section id="luminaries">
<h1>
Luminaries
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -82,7 +82,7 @@ <h1>
<section id="code-tabs">
<h1>
Code Tabs
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h1>
<section id="group-tabs">
<h1>
Group Tabs
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<section id="fruits">
<h1>
Fruits
<a class="headerlink" href="#fruits" title="Permalink to this headline">
<a class="headerlink" href="#fruits" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -54,7 +54,7 @@ <h1>
<section id="luminaries">
<h1>
Luminaries
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -82,7 +82,7 @@ <h1>
<section id="code-tabs">
<h1>
Code Tabs
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h1>
<section id="group-tabs">
<h1>
Group Tabs
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<section id="fruits">
<h1>
Fruits
<a class="headerlink" href="#fruits" title="Permalink to this headline">
<a class="headerlink" href="#fruits" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -54,7 +54,7 @@ <h1>
<section id="luminaries">
<h1>
Luminaries
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -82,7 +82,7 @@ <h1>
<section id="code-tabs">
<h1>
Code Tabs
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h1>
<section id="group-tabs">
<h1>
Group Tabs
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down
8 changes: 4 additions & 4 deletions tests/test_build/test_conditional_assets_index_.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<section id="fruits">
<h1>
Fruits
<a class="headerlink" href="#fruits" title="Permalink to this headline">
<a class="headerlink" href="#fruits" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -54,7 +54,7 @@ <h1>
<section id="luminaries">
<h1>
Luminaries
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -82,7 +82,7 @@ <h1>
<section id="code-tabs">
<h1>
Code Tabs
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h1>
<section id="group-tabs">
<h1>
Group Tabs
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down
8 changes: 4 additions & 4 deletions tests/test_build/test_conditional_assets_no_tabs1_.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<section id="fruits">
<h1>
Fruits
<a class="headerlink" href="#fruits" title="Permalink to this headline">
<a class="headerlink" href="#fruits" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -54,7 +54,7 @@ <h1>
<section id="luminaries">
<h1>
Luminaries
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -82,7 +82,7 @@ <h1>
<section id="code-tabs">
<h1>
Code Tabs
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h1>
<section id="group-tabs">
<h1>
Group Tabs
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down
8 changes: 4 additions & 4 deletions tests/test_build/test_conditional_assets_no_tabs2_.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<section id="fruits">
<h1>
Fruits
<a class="headerlink" href="#fruits" title="Permalink to this headline">
<a class="headerlink" href="#fruits" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -54,7 +54,7 @@ <h1>
<section id="luminaries">
<h1>
Luminaries
<a class="headerlink" href="#luminaries" title="Permalink to this headline">
<a class="headerlink" href="#luminaries" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -82,7 +82,7 @@ <h1>
<section id="code-tabs">
<h1>
Code Tabs
<a class="headerlink" href="#code-tabs" title="Permalink to this headline">
<a class="headerlink" href="#code-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h1>
<section id="group-tabs">
<h1>
Group Tabs
<a class="headerlink" href="#group-tabs" title="Permalink to this headline">
<a class="headerlink" href="#group-tabs" title="Permalink to this heading">
</a>
</h1>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_nested_markup.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<section id="markup-in-tab-titles">
<h1>
Markup in Tab Titles
<a class="headerlink" href="#markup-in-tab-titles" title="Permalink to this headline">
<a class="headerlink" href="#markup-in-tab-titles" title="Permalink to this heading">
</a>
</h1>
Expand Down