Skip to content
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

Python: Use PEP-420 package namespaces #3773

Open
1 task
kedare opened this issue Nov 19, 2024 · 0 comments
Open
1 task

Python: Use PEP-420 package namespaces #3773

kedare opened this issue Nov 19, 2024 · 0 comments
Labels
enhancement New feature or request new Un-triaged issue

Comments

@kedare
Copy link

kedare commented Nov 19, 2024

Description

Today, the way module are exposed to python is not really ergonomic as 1 root module is created for each terraform provider:

from cdktf_cdktf_provider_docker.image import Image
from cdktf_cdktf_provider_docker.container import Container
from cdktf_cdktf_provider_docker.provider import DockerProvider

Python is (one of the?) only implementation to have it implemented like this.

It would be interesting to migrate (or at least make it compatible with a non breaking way) with native package namespaces to allow a more natural naming

This would allow for example to have this kind of more natural and flexible imports

from cdktf.cdktf.provider.docker.image import Image
from cdktf.cdktf.provider.docker.container import Container
from cdktf.cdktf.provider.docker.provider import DockerProvider

References

https://packaging.python.org/en/latest/guides/packaging-namespace-packages

https://peps.python.org/pep-0420/

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@kedare kedare added enhancement New feature or request new Un-triaged issue labels Nov 19, 2024
@kedare kedare changed the title Python: Use PEP-420 package namepsaces Python: Use PEP-420 package namespaces Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new Un-triaged issue
Projects
None yet
Development

No branches or pull requests

1 participant