Repository navigation
docs(conf): build with sphinx-autodoc-typehints 3.15.0 (#1856) - #1877
Conversation
- Pin sphinx-autodoc-typehints to 3.15.0 in docs/requirements.txt. - Import resolve_type_guarded_imports from _resolve from 3.14 on and from _resolver before it, chosen by the installed release, so each branch is a plain import that still fails loudly if the private API moves again. - From 3.14 the library records a module's TYPE_CHECKING names instead of binding them, so Sphinx's own signature introspection lost them and schema signatures linked the wrong _VT; bind_guarded_names binds them again. - Run bind_type_checking_names on env-before-read-docs, after the library clears its guard record there. - Connect claim_attribute_signature only before 3.14, whose handler no longer returns a signature for an attribute. - Add tests/project/test_docs_typehints_pin_1856_unit.py. Closes #1856
|
Verdict: GOOD TO GO at
Correction to the PR body: the "18 in the baseline" came from a local venv with 3.13.6. Under the pinned 3.13.9 the baseline is also 0 warnings, so the gain is the linking, not a warning count. Merge note: on its own, this publishes |
|
Verdict: NEEDS CHANGES at
One required change. The rewritten |
…1856) - Pin sphinx-autodoc-typehints in the docs extra to the release docs/requirements.txt pins, so `pip install -e .[docs]` installs what the docs build runs. - Import its private modules unconditionally in conf.py, and drop the release check, the pre-3.14 fallbacks and claim_attribute_signature, which only an older release needed. - Gate every test that loads conf.py on HAS_SPHINX, which now also requires the pinned release and skips with a message saying which condition failed. - Add a test that the docs extra and docs/requirements.txt pin the same release, and update the HAS_SPHINX exclusion's reason. Closes #1856
9b59d10 to
57922c0
Compare
|
Verdict: GOOD TO GO at The earlier rounds' results stand:
|
|
Coverage: 90.05% (unit tier, Python 3.15,
Per-file detail: the |
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything else_resolver before it, chosen by the installed release, so each branch is a
plain import that still fails loudly if the private API moves again.
binding them, so Sphinx's own signature introspection lost them and schema
signatures linked the wrong _VT; bind_guarded_names binds them again.
clears its guard record there.
returns a signature for an attribute.
Closes #1856
Heads-up: rendering regression. 3.15.0 itself changes 273 signatures in the build, and 129 classes now render as
(*args, **kwargs). That includes protocol classes such asFTP(file=None, length=None, **kwargs), plus reassembly, traceflow andInfoclasses that rendered correctly before. Version 3.15.0 takes the class signature from__new__when a class defines both__new__and__init__, andProtocolBase,Reassembly,TraceFlowandInfoeach define a pass-through__new__. The fix is anautodoc-process-signaturehook inconf.py, which belongs with #1860. #1860's scope is widened to cover these classes, and theconf.pybatch (#1858–#1863) builds on this branch.