-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Explore the possibility of type hinting #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Ping? This is still annoying to have no auto completion in my IDE. Any chance of getting this in? |
/reopen |
@evanmosseri: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This issue is one reason I wrote my own generator: https://github.com/sebastian-philipp/rook-ceph-client-python |
/reopen |
@micw523: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen |
@micw523: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Type hinting would be more useful for using the APIs in this client (compared to config-loading, watch, etc), which are mostly generated by openapi-generator. I wonder if openapi-generator support type hinting. |
In the meantime, I've made https://github.com/ceph/rook-client-python to generate client API classes for CRDs . It contains a code generator that is usable independently of this project. If there is an interest, the code generator could certainly be moved into a dedicated project. |
Tracking here: OpenAPITools/openapi-json-schema-generator#30 |
I hacked together an external type stubs package for now: https://pypi.org/project/kubernetes-stubs/. Perhaps it's of use to some other folks! |
For those who want to typecheck existing custom resources without generating additional code - I've created |
This is such a needed feature 🥲 |
/help |
@roycaihw: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
kubernetes-stubs has not provided stubs for kubernetes >= 23.0 yet (2023-06-03). I forked it to kubernetes-stubs-elephant-fork which provides stubs for all releases after 7.0 of kubernetes, I run a crontab by github actions which looks for new releases of kubernetes and build typing stubs for it. |
How is this feature not being provided by the main k8s client library for Python? |
8 years later, k8s python client still does not provide type hints. |
Python 3 has a type hinting feature very useful for auto complete. This issue is for tracking efforts on researching its backward compatibility with python 2 (
from __future__ import import annotations
?) and if possible, change code generator to implement it. Best if we contribute it back to swagger-codegen.The text was updated successfully, but these errors were encountered: