Fix provider docs build failing under Python 3.12 - #70957
Closed
potiuk wants to merge 2 commits into
Closed
Conversation
Python 3.12 added __type_params__ to functools.WRAPPER_ASSIGNMENTS. The provider docs mock smbclient through autodoc_mock_imports, and a mock returns another mock for that attribute rather than a tuple, so functools refuses the assignment and importing the hook raises TypeError. Every method on SambaHook wraps an smbclient callable, so the module fails at class-definition time and Sphinx cannot document the provider at all. The docs build only started running under Python 3.12 on 2026-07-28, which is when publishing began failing; nothing in the provider itself changed. None of the wrapped callables are PEP 695 generics, so the attribute carries no information worth copying and everything functools normally inherits is left untouched.
Building the provider docs under Python 3.12 surfaces thirteen "more than one target found for cross-reference" reports across amazon, google and openlineage. They are raised where two documented classes share a member name - ``object`` is a documented parameter of both GCSObjectExistenceSensor and GCSObjectUpdateSensor, ``CommandType`` exists in both the ECS and Lambda executor utils, and so on. The offending references sit in autoapi-generated rst, so there is no place to write a qualified name, and the duplication itself is legitimate. Sphinx exposes no narrower subtype than ref.python for this message, so suppressing it is the only way to let the build finish; the trade-off is that a genuinely unresolvable python reference will no longer fail the docs build.
Member
Author
|
hmm - closing this one. This shows that common image for both docs and registry build was a bad idea @kaxil . I will still leave parallel jobs but with separate images - and cache should take care about speed. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Publishing the provider docs has failed since 2026-07-28. The last green run built with no
--pythonflag; every run since passes--python 3.12. Nothing in the repo changed — only four commits sit between the last green and first red run (INTHEWILD.md, a secrets-backend change, a UI toggle, Helm docs). Two independent problems surface only on 3.12.1. Samba fails to import, so the provider cannot be documented at all
Python 3.12 added
__type_params__tofunctools.WRAPPER_ASSIGNMENTS.smbclientis inautodoc_mock_imports, and a Sphinx mock returns another mock for that attribute rather than a tuple, sofunctoolsrefuses the assignment:Every
SambaHookmethod wraps ansmbclientcallable, so the module dies at class-definition time. This is not a Sphinx regression — it reproduces identically on Sphinx 8.2.3, 9.0.4 and 9.1.0.All 24 wrapped methods now go through a helper that copies everything
functoolsnormally copies except__type_params__. None of the wrapped callables are PEP 695 generics, so nothing is lost — verified that__doc__,__name__and__wrapped__are still inherited fromsmbclientwhen it is not mocked.2. Thirteen ambiguous cross-references
amazon,googleandopenlineageraise "more than one target found for cross-reference" where two documented classes share a member name —objectis a documented parameter of bothGCSObjectExistenceSensorandGCSObjectUpdateSensor,CommandTypeexists in both the ECS and Lambda executor utils, and so on.These references live in autoapi-generated rst, so there is no place to write a qualified name, and the duplication is legitimate.
autodoc_typehints_formatdoes not help: most of these are:paramnames, not type annotations. Sphinx exposes no subtype narrower thanref.pythonfor this message.Reviewers should weigh this trade-off: suppressing
ref.pythonalso means a genuinely unresolvable python reference will no longer fail the docs build. If that is unacceptable, the alternative is leaving the docs build red until each duplicate member name is renamed, which is a much larger change across three providers.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines