From f2b4714602a1e17223285dd49d94c61b86bfbec9 Mon Sep 17 00:00:00 2001 From: David Foster <31405412+foster999@users.noreply.github.com> Date: Sun, 26 Jun 2022 00:03:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Add=20support=20and?= =?UTF-8?q?=20testing=20for=20sphinx=205=20(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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> --- .github/workflows/tests.yml | 6 +++--- setup.py | 9 +++++---- tests/conftest.py | 6 ++++++ tests/test_build.py | 3 ++- ...est_conditional_assets_html_assets_policy_index_.html | 8 ++++---- ..._conditional_assets_html_assets_policy_no_tabs1_.html | 8 ++++---- ..._conditional_assets_html_assets_policy_no_tabs2_.html | 8 ++++---- tests/test_build/test_conditional_assets_index_.html | 8 ++++---- tests/test_build/test_conditional_assets_no_tabs1_.html | 8 ++++---- tests/test_build/test_conditional_assets_no_tabs2_.html | 8 ++++---- tests/test_build/test_nested_markup.html | 2 +- 11 files changed, 41 insertions(+), 33 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b7414e8..b76189b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/setup.py b/setup.py index cb60110..81267ed 100755 --- a/setup.py +++ b/setup.py @@ -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", @@ -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", diff --git a/tests/conftest.py b/tests/conftest.py index 6c15bd4..b1f0728 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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.""" diff --git a/tests/test_build.py b/tests/test_build.py index a44a9ef..2e32014 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -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, diff --git a/tests/test_build/test_conditional_assets_html_assets_policy_index_.html b/tests/test_build/test_conditional_assets_html_assets_policy_index_.html index 1032d5e..66f00b1 100644 --- a/tests/test_build/test_conditional_assets_html_assets_policy_index_.html +++ b/tests/test_build/test_conditional_assets_html_assets_policy_index_.html @@ -18,7 +18,7 @@

Fruits - +

@@ -54,7 +54,7 @@

Luminaries - +

@@ -82,7 +82,7 @@

Code Tabs - +

@@ -182,7 +182,7 @@

Group Tabs - +

diff --git a/tests/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.html b/tests/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.html index 1032d5e..66f00b1 100644 --- a/tests/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.html +++ b/tests/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.html @@ -18,7 +18,7 @@

Fruits - +

@@ -54,7 +54,7 @@

Luminaries - +

@@ -82,7 +82,7 @@

Code Tabs - +

@@ -182,7 +182,7 @@

Group Tabs - +

diff --git a/tests/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.html b/tests/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.html index 1032d5e..66f00b1 100644 --- a/tests/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.html +++ b/tests/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.html @@ -18,7 +18,7 @@

Fruits - +

@@ -54,7 +54,7 @@

Luminaries - +

@@ -82,7 +82,7 @@

Code Tabs - +

@@ -182,7 +182,7 @@

Group Tabs - +

diff --git a/tests/test_build/test_conditional_assets_index_.html b/tests/test_build/test_conditional_assets_index_.html index 1032d5e..66f00b1 100644 --- a/tests/test_build/test_conditional_assets_index_.html +++ b/tests/test_build/test_conditional_assets_index_.html @@ -18,7 +18,7 @@

Fruits - +

@@ -54,7 +54,7 @@

Luminaries - +

@@ -82,7 +82,7 @@

Code Tabs - +

@@ -182,7 +182,7 @@

Group Tabs - +

diff --git a/tests/test_build/test_conditional_assets_no_tabs1_.html b/tests/test_build/test_conditional_assets_no_tabs1_.html index 1032d5e..66f00b1 100644 --- a/tests/test_build/test_conditional_assets_no_tabs1_.html +++ b/tests/test_build/test_conditional_assets_no_tabs1_.html @@ -18,7 +18,7 @@

Fruits - +

@@ -54,7 +54,7 @@

Luminaries - +

@@ -82,7 +82,7 @@

Code Tabs - +

@@ -182,7 +182,7 @@

Group Tabs - +

diff --git a/tests/test_build/test_conditional_assets_no_tabs2_.html b/tests/test_build/test_conditional_assets_no_tabs2_.html index 1032d5e..66f00b1 100644 --- a/tests/test_build/test_conditional_assets_no_tabs2_.html +++ b/tests/test_build/test_conditional_assets_no_tabs2_.html @@ -18,7 +18,7 @@

Fruits - +

@@ -54,7 +54,7 @@

Luminaries - +

@@ -82,7 +82,7 @@

Code Tabs - +

@@ -182,7 +182,7 @@

Group Tabs - +

diff --git a/tests/test_build/test_nested_markup.html b/tests/test_build/test_nested_markup.html index 3b6f504..b77df2c 100644 --- a/tests/test_build/test_nested_markup.html +++ b/tests/test_build/test_nested_markup.html @@ -4,7 +4,7 @@

Markup in Tab Titles - +