Description
Describe the bug
I'm not sure if this is something that the Sphinx team even is interested in explicitly supporting, but the latest release of the sphinxcontrib
tooling cannot be used with rules_python
(i.e. by users that use Bazel to install Sphinx).
We build our monorepo's docs at work with Sphinx, and today when running some automated tooling to bump package versions, I encountered issues like the following:
$ bazel build //...
ERROR: /home/bruno/.cache/bazel/_bazel_bruno/8f2b6fc37214e29f3e0fada1717a9254/external/pip_sphinx/BUILD.bazel:22:11: in py_library rule @pip_sphinx//:pkg: cycle in dependency graph:
//building/python/sphinx:build_wrapper (ebf05eacb2537ac9057c50f99af724bc4fbe8ed0ce57ceeb546c8f679dec84e5)
.-> @pip_sphinx//:pkg (ebf05eacb2537ac9057c50f99af724bc4fbe8ed0ce57ceeb546c8f679dec84e5)
| @pip_sphinxcontrib_devhelp//:pkg (ebf05eacb2537ac9057c50f99af724bc4fbe8ed0ce57ceeb546c8f679dec84e5)
`-- @pip_sphinx//:pkg (ebf05eacb2537ac9057c50f99af724bc4fbe8ed0ce57ceeb546c8f679dec84e5)
These errors can easily be solved by pinning the older versions at one patch number below the current one:
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
The error is caused by the fact that at some point since the last release of these packages, Sphinx>5
was added as an explicit dependency of these packages, creating the dependency loops demonstrated above. For example, compare the setup.py
of serializainghtml at 1.1.5 to its new pyproject.toml
. This particular breakage appears to originate here.
I recognize that most Python users are not also Bazel users, so I also created a minimal Git repo that reproduces the issue.
The requirements_lock.txt
in this repo was produced by:
$ conda create -n sphinx_repro python=3.10
$ conda activate sphinx_repro
$ pip install sphinx
$ pip freeze > requirements_lock.txt
Please let me know if there is interest in resolving this issue here, and if so if I can help in any way!
How to Reproduce
$ git clone git@github.com:brunobeltran/minimal-sphinx-repro.git
$ cd minimal-sphinx-repro
$ bazel build //...
Environment Information
Platform: linux; (Linux-6.1.0-10-amd64-x86_64-with-glibc2.36)
Python version: 3.10.12 (main, Jul 5 2023, 18:54:27) [GCC 11.2.0])
Python implementation: CPython
Sphinx version: 7.1.2
Docutils version: 0.20.1
Jinja2 version: 3.1.2
Pygments version: 2.16.1
Sphinx extensions
No response