Fix autodoc tests for Python 3.11+#11793
Merged
AA-Turner merged 3 commits intosphinx-doc:masterfrom Dec 26, 2023
Merged
Conversation
|
Sorry for the breakage from CPython! It was my decision to backport, and I probably should have thought more carefully about the possible impact on documentation tools like Sphinx. Thanks so much @hugovk for filing the PR to fix things! |
sobolevn
reviewed
Dec 11, 2023
Contributor
sobolevn
left a comment
There was a problem hiding this comment.
I propose simplifing this check.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature or Bugfix
Purpose
Detail
Since Python 3.11.7, 3.12.0 and 3.13.0a2, "list of weak references to the object (if defined)" was changed to "list of weak references to the object".
Add a version check to decide text to assert.
Before: https://github.com/sphinx-doc/sphinx/actions/runs/7158385030?pr=11791
After: https://github.com/sphinx-doc/sphinx/actions/runs/7166386276?pr=11793
("Docutils HEAD" fails because https://repo.or.cz/docutils.git/ is 403 -- see PR #11794 -- and Windows fails with
test_gettext_dont_rebuild_mo.)Also in Ruff v0.1.0:
So use that option for "Lint with latest Ruff" to prevent
error: unexpected argument '--format' found.https://github.com/astral-sh/ruff/releases/tag/v0.1.0
Relates
(if defined)part from__dict__and__weakref__docstrings python/cpython#112268