Skip to content

Commit

Permalink
👌 IMPROVE: Add support and testing for sphinx 5 (#164)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
foster999 and pre-commit-ci[bot] committed Jun 25, 2022
1 parent 88a096f commit f2b4714
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
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
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
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
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
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
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
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
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
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
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
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

0 comments on commit f2b4714

Please sign in to comment.