Skip to content

[typing] type public client helpers - #12

Closed
tamird wants to merge 1 commit into
lexdene:masterfrom
tamird:type-watch-stream-events
Closed

tamird wants to merge 1 commit into
lexdene:masterfrom
tamird:type-watch-stream-events

Conversation

@tamird

@tamird tamird commented Jun 20, 2026 •

Copy link
Copy Markdown

kubernetes-stubs is partial, so an omitted module or member falls
back to the runtime package. The runtime is mostly unannotated, so
Watch streams, quantity helpers, and the ApiClient stored by generated
API classes become Any.

Describe Watch.stream in terms of the watched callable's list item
type or the class literal passed to Watch. Preserve the callable's
arguments with ParamSpec. Model bookmark and invalid-line results
explicitly. Calls that set deserialize and non-list methods remain
object: the runtime consumes that keyword itself and uses docstrings,
not the callable's return annotation, to distinguish log streams.

Mirror the runtime's package-shaped kubernetes.watch and
kubernetes.utils modules. Add the public quantity and ApiClient
interfaces, generate api_client on each API class, and retain the
handwritten client exports when the generator writes its final
__all__.

Use uv for code generation, wheel builds, and checker dependencies so
local checks and release workflows share one locked environment. The
pull-request check builds and installs a Kubernetes 36.0.2 wheel,
removes the generated source tree, and exercises the public types with
mypy, Pyright, and ty.

Ty currently leaves the generic protocol specialization as Unknown.
The three affected assertions stay enforced by mypy and Pyright; ty
uses scoped suppressions and will report them as unused when its
constraint solver supports this case.

@tamird
tamird force-pushed the type-watch-stream-events branch 6 times, most recently from ca757ba to 98cdb8f Compare June 20, 2026 11:39
@tamird
tamird marked this pull request as draft June 20, 2026 15:54
@tamird
tamird force-pushed the type-watch-stream-events branch from 98cdb8f to b0d8253 Compare June 20, 2026 18:54
@tamird tamird changed the title [watch] type stream events [typing] type public client helpers Jun 20, 2026
@tamird
tamird marked this pull request as ready for review June 20, 2026 18:59
@tamird
tamird marked this pull request as draft June 20, 2026 20:05
@tamird
tamird marked this pull request as ready for review June 20, 2026 22:10
@tamird
tamird force-pushed the type-watch-stream-events branch 6 times, most recently from 32cbc48 to cb838d7 Compare June 21, 2026 01:11
@tamird

tamird commented Jun 21, 2026

Copy link
Copy Markdown
Author

@lexdene my codex went a little further than expected here, but I did have it split the changes into multiple commits in case you wanted to merge without squashing or if you want, I am happy to send multiple PRs. Please let me know, and thanks for maintaining this project!

@lexdene

lexdene commented Jun 23, 2026

Copy link
Copy Markdown
Owner

This PR is too large for me to review thoroughly.
I suggest breaking it down and focusing this one solely on the changes related to the kubernetes.watch typing.

Type kubernetes.watch events using the watched list method or an explicit model class. Preserve bookmark, raw, log, and argument-forwarding behavior in focused type-checker coverage.

Anchor the generated-package ignore rule so the new watch stub sources are included in the built distribution.
@tamird
tamird force-pushed the type-watch-stream-events branch from cb838d7 to d7ddc2d Compare July 22, 2026 20:25
@tamird

tamird commented Jul 24, 2026

Copy link
Copy Markdown
Author

@tamird tamird closed this Jul 24, 2026
@tamird
tamird deleted the type-watch-stream-events branch July 31, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants