Python type stubs for the Kubernetes API client. The code has been forked from MaterializeInc/kubernetes-stubs. Stubs are contained in Git branches, which are named after the respective Kubernetes client version.
pip install git+https://github.com/kialo/[email protected]
Alternatively, declare it as a dependency in your pyproject.toml
.
poetry:
[tool.poetry.dependencies]
kubernetes-asyncio-stubs = { rev = "29.0.1", git = "https://github.com/kialo/kubernetes_asyncio-stubs" }
uv:
[tool.uv]
dev-dependencies = [
"kubernetes-stubs @ git+https://github.com/kialo/[email protected]",
]
Remember to change the version number accordingly.
These stubs are not complete, and in some cases may be incorrect. Follow these steps to adapt or extend the stubs:
- Include missing annotations in the base files under
codegen/base/
, preferably on themaster
branch. - Switch to a Git branch named after the
kubernetes_asyncio
version you are generating stubs for, and checkout the corresponding tag of thekubernetes_asyncio
submodule. - Run
uv sync && uv run codegen
to generate stubs from the Kubernetes OpenAPI spec.