MaterializeInc / kubernetes-stubs

Python type stubs for the Kubernetes API client.
7 stars 11 forks source link

ApiClient is not re-exported #9

Open adamnovak opened 2 years ago

adamnovak commented 2 years ago

https://github.com/MaterializeInc/kubernetes-stubs/blob/15ad1215405dfb7d4021b17e93a1cb37c99fc1fe/kubernetes-stubs/client/__init__.pyi#L99

This needs to be from kubernetes.client.api_client import ApiClient as ApiClient, or you get:

src/toil/batchSystems/kubernetes.py:215:22: error: Module has no attribute "ApiClient"  [attr-defined]
            api_client = kubernetes.client.ApiClient()

This is when I import kubernetes and when I import kubernetes.client.

simonfontana commented 2 years ago

I have the same issue. I also found two more issues when running mypy on our code:

from kubernetes import config
config.list_kube_config_contexts()

Gives: _error: Module has no attribute "list_kube_configcontexts"

from kubernetes import config
config.new_client_from_config(context=self.context["name"])

Gives: _error: Module has no attribute "new_client_fromconfig"