-
Notifications
You must be signed in to change notification settings - Fork 28
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
sphinx~=7.3.0 breaks sphinx-immaterial #345
Comments
As for using private APi in sphinx, we really can't avoid this without removing some theme-specific features. It would nice if we didn't have to, but Sphinx domains are a bit rigid. See #113 (comment)
As for this, I don't see @AA-Turner I don't think it was a good idea to move public API into private modules. That move tells me that only
It looks like the domain refactor in sphinx-doc/sphinx@v7.2.6...v7.3.5 was not specific to just the python domain. Our docs now fail (with v7.3.5) about cpp domain as well. This one might take us a while to resolve... |
We need to pin sphinx<7.3.0 because the sphinx-immterial theme doesn't work with it yet [1]. [1] jbms/sphinx-immaterial#345
I was able to get a sphinx-immaterial build working nominally with just an import of most/all things removed in pre 7.3.0 sphinx.domains.{c,cop,python}, sphinx-doc/sphinx#12297, so that's hopeful that the issue is restricted to a subset of those changes. |
You'll need to change sphinx-immaterial/sphinx_immaterial/apidoc/python/style_default_values_as_code.py Line 28 in 9519601
to try:
if sphinx.version_info >= (7, 3):
sphinx.domains.python._annotation._parse_arglist = parse_arglist
sphinx.domains.python._object._parse_arglist = parse_arglist
else:
sphinx.domains.python._parse_arglist = parse_arglist
except AttributeError:
# log some warning rather than crashing |
Sphinx 7.3.6 has been released with fixes. A |
sphinx-immaterial/docs/conf.py Lines 353 to 354 in 9519601
which is causing:
This poses a problem in sphinx-immaterial/docs/apidoc/python/apigen.rst Lines 309 to 342 in 9519601
where most of it can be generated from conf.py, but using a function extracted from a sys path is a unique obstacle:
sphinx-immaterial/docs/apidoc/python/apigen.rst Lines 340 to 341 in 9519601
Other sphinx-immaterial/docs/apidoc/python/index.rst Lines 52 to 56 in 9519601
But that should be an easier fix. |
Geez. Even the typing for public API changed quite significantly.
I'm not going to lie. This one is a pain in the ass. There's usually one or two things we need to update for a minor version bump... 😞 Also, v7.3 is ripe with merge commits in the master branch (which makes it harder to git blame a PR or instigating issue when looking for rationality). It would be a good idea to start putting a reference to a discussion (PR or issue) in the merge commit's description. |
Thank you for the feedback, Brendan (@2bndy5).
The intent here was to make the type hints (intended usage) stricter, whilst the runtime acceptable values didn't change. Any examples of mypy failing would be useful.
It still does at runtime, the static typing information has become stricter, though, to reflect intended use.
All previously valid values should still be valid. I'm happy to tweak the type hints if needed (suggestions welcome). A |
I don't think
When I change |
Mypy runs fine for me on the first two of the below three test-cases, and only reports an error for the third -- I suspect this might actually be an error with Mypy's implementation/special casing of from sphinx.application import Sphinx
def setup(app: Sphinx) -> None:
app.add_config_value(
'spam',
None,
'',
(bool, str, type(None))
)
app.add_config_value(
'ham',
None,
'',
(bool, str)
)
app.add_config_value(
'ham',
None,
'',
(bool, type(None)) # mypy error: incompatible type ...
) Sorry to cause trouble, though, it isn't intended and thank you for your co-operation in trying to improve the situation. A |
Thanks for your consideration. For passers by, this error was reported with mypy v1.8.0 and v1.9.0. |
Sphinx recently updated to 7.3.*.
This came with some public interface breakages, which sphinx-immaterial uses, detailed in this issue: sphinx-doc/sphinx#12295.
Additionally, sphinx-immaterial uses some more private-leaning methods and functions from sphinx (sphinx-doc/sphinx#12297), which have the potential to be moved/broken/removed in the future.
The text was updated successfully, but these errors were encountered: