From f0b76043a49e8969be1f0bfed7ad5636d7361e3c Mon Sep 17 00:00:00 2001 From: phlax Date: Sat, 13 Jan 2024 02:35:03 +0000 Subject: [PATCH] Remove Sphinx as a required dependency (#10) Signed-off-by: Ryan Northey Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- CHANGES | 7 +++++++ pyproject.toml | 7 ++++--- sphinxcontrib/serializinghtml/__init__.py | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 794d170..8cd7db1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install .[test] + python -m pip install .[test,standalone] - name: Test with pytest run: python -m pytest -vv --durations 25 diff --git a/CHANGES b/CHANGES index c91fed7..48c08f4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Release 1.1.10 (unreleased) +=========================== + +* Remove Sphinx as a required dependency, as circular dependencies may cause + failure with package managers that expect a directed acyclic graph (DAG) + of dependencies. + Release 1.1.9 (2023-08-20) ========================== diff --git a/pyproject.toml b/pyproject.toml index 8c39008..7f88862 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,9 +40,7 @@ classifiers = [ "Topic :: Text Processing", "Topic :: Utilities", ] -dependencies = [ - "Sphinx>=5", -] +dependencies = [] dynamic = ["version"] [project.optional-dependencies] @@ -54,6 +52,9 @@ lint = [ "mypy", "docutils-stubs", ] +standalone = [ + "Sphinx>=5", +] [[project.authors]] name = "Georg Brandl" diff --git a/sphinxcontrib/serializinghtml/__init__.py b/sphinxcontrib/serializinghtml/__init__.py index 8940d80..815705c 100644 --- a/sphinxcontrib/serializinghtml/__init__.py +++ b/sphinxcontrib/serializinghtml/__init__.py @@ -157,6 +157,7 @@ class JSONHTMLBuilder(SerializingHTMLBuilder): def setup(app: Sphinx) -> dict[str, Any]: + app.require_sphinx('5.0') app.setup_extension('sphinx.builders.html') app.add_builder(JSONHTMLBuilder) app.add_builder(PickleHTMLBuilder)