Skip to content

Use of deprecated pkg_resources #291

@jakub-mikians-airspace-intelligence

Description

When I import google package I get the following deprecation notice:

/usr/lib/python3.11/site-packages/google/__init__.py:17: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  __import__('pkg_resources').declare_namespace(__name__)

Reproduction:

 python -c 'import google; print(google)'

This warning seems to be caused by google-sql-commenter==2.0.0. When I remove this package from dependencies, I don't get the warning. The warning pops because, google-sql-commenter puts the following file into google dir: /usr/lib/python3.11/site-packages/google/__init__.py

# ...
__import__('pkg_resources').declare_namespace(__name__)

https://github.com/google/sqlcommenter/blob/master/python/sqlcommenter-python/google/__init__.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions