Repository navigation
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: NEEDS CHANGES at
What the review confirmed:
Optional: |
0f93ff5 to
3cabc14
Compare
|
Verdict: GOOD TO GO at
Merge #1877 first: this PR is stacked on it. |
|
what about we pin the typehints version so we dont need the branching? |
|
Agreed. The plan:
A worker will add this to #1877 and rebase this PR onto it. Both review labels reset when the new heads land. |
3cabc14 to
8c796f6
Compare
|
Verdict: NEEDS CHANGES at One required change, the same as on #1877. The |
…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
…d viewcode's index (#1858, #1859, #1860, #1861, #1862, #1863) - Name aenum classes aenum.X through a typehints_formatter, so a union with the stdlib namesake no longer reads IntEnum | IntEnum (#1858). - Turn on autodoc_preserve_defaults, and name a class that a default reaches through a private import alias by its own name (#1859). - Give a class whose __init__ a pass-through or deeper __new__ hides from autodoc that __init__'s parameters, and have sphinx-autodoc-typehints read the class's parameter types from it too (#1860). - Take a wrapped table's ids off furo's table-wrapper container (#1861). - Give every enumeration the (*values) signature (#1862). - Keep viewcode on the module binding an alias that reports builtins (#1863). - Add a tests/project unit test per issue, gated on the pinned release, and register their furo gate in tests/_dependency_gates.py. Closes #1858 Closes #1859 Closes #1860 Closes #1861 Closes #1862 Closes #1863
8c796f6 to
ec97be1
Compare
|
Verdict: GOOD TO GO at Merge #1877 first. |
|
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 elseStacked on #1877. It contains #1877's commit until that merges, so merge #1877 first. This PR's own commit is
0f93ff5cf.All six fixes are in
docs/source/conf.py. The figures below are from builds under the pinned sphinx-autodoc-typehints 3.15.0, comparing #1877's head with this commit.IntEnum | IntEnumandEnum | Enum#1858: aenum classes render asaenum.IntEnum, soIntEnum | IntEnumis gone from every page.sys.byteordershows the build host's'little'#1859:autodoc_preserve_defaultsis on, sobyteorder=sys.byteorderreplaces the build host's value. A default reached through a private import alias is named by its own class.InfoandSchemasubclasses render the base__new__'s(*args, **kwargs)signature, not their fields #1860: a class whose__init__is hidden by__new__gets that__init__'s parameters. Class catch-all signatures went from 991 to 71. The 71 left are unfinalised Info/Schema bases, whose real__init__is generated on first use.const/reg.htmlcarries duplicate ids #1861: a post-transform moves wrapped tables' ids off furo'stable-wrapper, soconst/reg.htmlhas no duplicate ids.(*values).builtinspage that is never generated #1863:_modules/index.htmlno longer links a missingbuiltins.html.Worth a look. To restore class parameter types in docstrings under 3.15.0,
read_constructor_types_from_initrepoints the library's privateconstructor_name. It is a separable hunk if patching the library is unwanted.Both builds finish with 0 warnings. Each new
tests/projectmodule fails with its fix reverted. Fulltests/project: 1016 passed, 7 skipped.Closes #1858
Closes #1859
Closes #1860
Closes #1861
Closes #1862
Closes #1863