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

DeprecationWarning for pkg_resources.declare_namespace usage in google.cloud #1000

Closed
skshetry opened this issue Mar 6, 2023 · 1 comment · Fixed by #1176
Closed

DeprecationWarning for pkg_resources.declare_namespace usage in google.cloud #1000

skshetry opened this issue Mar 6, 2023 · 1 comment · Fixed by #1176
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. 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

@skshetry
Copy link

skshetry commented Mar 6, 2023

Starting from setuptools==67.3.0, it has started raising DeprecationWarning. Some libraries treat them as errors during testing.

See: https://setuptools.pypa.io/en/latest/history.html#v67-3-0.

/lib/python3.11/site-packages/pkg_resources/__init__.py:2804: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google.cloud')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

This could be fixed by switching to new layout as specified in PEP 420, by dropping __init__.py.

See similar discussion in matplotlib/matplotlib#25244 and pypa/setuptools#3434 (comment).

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Mar 6, 2023
@andrewsg andrewsg self-assigned this Mar 9, 2023
@andrewsg andrewsg 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 Mar 9, 2023
@DanielArmyrConversy
Copy link

DanielArmyrConversy commented Sep 14, 2023

Yep, seeing this too. Using google-cloud-translate 3.12.0

[...]/lib/python3.10/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google.logging'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. 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.

3 participants