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

Remove dependency on pkg_resources #140

Closed
bivald opened this issue Oct 3, 2022 · 4 comments · Fixed by #187
Closed

Remove dependency on pkg_resources #140

bivald opened this issue Oct 3, 2022 · 4 comments · Fixed by #187
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@bivald
Copy link

bivald commented Oct 3, 2022

Is your feature request related to a problem? Please describe.
Trying to reduce boot time for my Cloud Run API I'm profiling imports, and google.rpc add significant time to the applications imports due to the use of pkg_resources

Describe the solution you'd like
Similar to googleapis/python-api-core#361 - it would be awesome if we could remove the use or pkg_resources (not idea of the effort though)

@parthea parthea added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Oct 3, 2022
@jenshnielsen
Copy link

In addition to the above setuptools has now deprecated the use of pkg_resources.declare_namespace
which is still used in this package here https://github.com/googleapis/python-api-common-protos/blob/main/google/rpc/__init__.py and possibly elsewhere.

See the setuptools changelog

@JordiSalaJuarez
Copy link

Let me know if this is a good idea, I feel like we can do better than filtering warnings but I don't know if there will be side effects on other projects if we use implicit namespaces, this fix uses PEP 420 which is the desired way by setuptools

@meredithslota
Copy link

Dependent libraries still use https://github.com/googleapis/python-datastore/blob/main/google/__init__.py files — do these need to be removed manually?

@parthea
Copy link
Contributor

parthea commented Nov 8, 2023

Yes, it is necessary to remove __init__.py once we migrate to native namespace packages as per https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#native-namespace-packages. This work was already completed in google-auth via googleapis/google-auth-library-python#1205. We will need to make a similar PR in each python repository in the googleapis organization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants