Repository navigation
Declare __all__ in public subpackages - #2725
Conversation
The py.typed marker makes type checkers treat names imported in __init__.py as private unless they are re-exported, so pyright rejected documented calls such as utils.create_from_yaml and config.load_kube_config.
|
|
|
Welcome @r4victor! |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: r4victor, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9c5f434
into
kubernetes-client:master
What type of PR is this?
/kind bug
What this PR does / why we need it:
Add
__all__tokubernetes.config,kubernetes.stream,kubernetes.utils,kubernetes.watchand theirkubernetes.aiocounterparts so that type checkers treat their documented functions and classes as public, which they stopped doing once the package shippedpy.typed.Which issue(s) this PR fixes:
Fixes #2724
Special notes for your reviewer
__all__rather than as aliases:kubernetes.informerandkubernetes.aioalready declare their exports with__all__, and it leaves the existing imports untouched.__all__would wrongly fail when a name is imported for internal use only.__all__.Does this PR introduce a user-facing change?