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

⬆️ UPGRADE: sphinx>=5,<8 #148

Merged
merged 3 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 10 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@ jobs:
tests:

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
sphinx-version: ["~=7.0"]
include:
- os: ubuntu-latest
python-version: 3.8
sphinx-version: "~=5.0"
- os: ubuntu-latest
python-version: 3.8
sphinx-version: "~=6.0"
- os: windows-latest
python-version: 3.8
sphinx-version: "~=7.0"

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

Expand All @@ -43,7 +52,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[testing]
pip install --upgrade "sphinx${{ matrix.sphinx-version }}" -e .[testing]
- name: Run pytest
run: |
pytest --cov=sphinx_design --cov-report=xml --cov-report=term-missing
Expand All @@ -56,29 +65,6 @@ jobs:
file: ./coverage.xml
fail_ci_if_error: true

tests-sphinx4:

strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.10"]

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

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[testing] sphinx~=4.5
- name: Run pytest
run: pytest

docs-build-format:

runs-on: ubuntu-latest
Expand Down Expand Up @@ -108,7 +94,6 @@ jobs:
needs:
- pre-commit
- tests
- tests-sphinx4
- docs-build-format

runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ classifiers = [
]
keywords = ["sphinx", "extension", "material design", "web components"]
requires-python = ">=3.8"
dependencies = ["sphinx>=4,<7"]
dependencies = ["sphinx>=5,<8"]

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

[project.optional-dependencies]
code_style = ["pre-commit>=2.12,<4.0"]
rtd = ["myst-parser>=0.18.0,<2"]
rtd = ["myst-parser>=1,<3"]
testing = [
"myst-parser>=0.18.0,<2",
"myst-parser>=1,<3",
"pytest~=7.1",
"pytest-cov",
"pytest-regressions",
Expand Down
26 changes: 18 additions & 8 deletions tests/test_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ def test_snippets_rst(
builder.src_path.joinpath("index.rst").write_text(content, encoding="utf8")
write_assets(builder.src_path)
builder.build()
pformat = builder.get_doctree("index").pformat()
doctree = builder.get_doctree("index", post_transforms=False)
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
file_regression.check(
pformat,
doctree.pformat(),
basename=f"snippet_pre_{path.name[:-len(path.suffix)]}",
extension=".xml",
encoding="utf8",
Expand All @@ -56,8 +57,10 @@ def test_snippets_myst(
builder.src_path.joinpath("index.md").write_text(content, encoding="utf8")
write_assets(builder.src_path)
builder.build()
doctree = builder.get_doctree("index", post_transforms=False)
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
file_regression.check(
builder.get_doctree("index").pformat(),
doctree.pformat(),
basename=f"snippet_pre_{path.name[:-len(path.suffix)]}",
extension=".xml",
encoding="utf8",
Expand All @@ -78,9 +81,10 @@ def test_snippets_rst_post(
builder.src_path.joinpath("index.rst").write_text(content, encoding="utf8")
write_assets(builder.src_path)
builder.build()
pformat = builder.get_doctree("index", post_transforms=True).pformat()
doctree = builder.get_doctree("index", post_transforms=True)
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
file_regression.check(
pformat,
doctree.pformat(),
basename=f"snippet_post_{path.name[:-len(path.suffix)]}",
extension=".xml",
encoding="utf8",
Expand All @@ -101,8 +105,10 @@ def test_snippets_myst_post(
builder.src_path.joinpath("index.md").write_text(content, encoding="utf8")
write_assets(builder.src_path)
builder.build()
doctree = builder.get_doctree("index", post_transforms=True)
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
file_regression.check(
builder.get_doctree("index", post_transforms=True).pformat(),
doctree.pformat(),
basename=f"snippet_post_{path.name[:-len(path.suffix)]}",
extension=".xml",
encoding="utf8",
Expand All @@ -117,8 +123,10 @@ def test_sd_hide_title_rst(
content = ":sd_hide_title:\n\nHeading\n-------\n\ncontent"
builder.src_path.joinpath("index.rst").write_text(content, encoding="utf8")
builder.build()
doctree = builder.get_doctree("index", post_transforms=False)
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
file_regression.check(
builder.get_doctree("index", post_transforms=False).pformat(),
doctree.pformat(),
basename="sd_hide_title",
extension=".xml",
encoding="utf8",
Expand All @@ -133,8 +141,10 @@ def test_sd_hide_title_myst(
content = "---\nsd_hide_title: true\n---\n\n# Heading\n\ncontent"
builder.src_path.joinpath("index.md").write_text(content, encoding="utf8")
builder.build()
doctree = builder.get_doctree("index", post_transforms=False)
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
file_regression.check(
builder.get_doctree("index", post_transforms=False).pformat(),
doctree.pformat(),
basename="sd_hide_title",
extension=".xml",
encoding="utf8",
Expand Down
6 changes: 1 addition & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ envlist = py38
[testenv]
usedevelop = true

[testenv:py{37,38,39,310}]
[testenv:py{38,39,310,311}]
description = Run unit tests with this Python version
extras =
testing
deps =
black
flake8~=3.8
flake8-bugbear~=21.3
commands = pytest {posargs}

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