googleapis / python-crc32c

Apache License 2.0
22 stars 25 forks source link

DeprecationWarning: pkg_resources is deprecated as an API #168

Closed GergelyKalmar closed 8 months ago

GergelyKalmar commented 1 year ago

I'm getting a DeprecationWarning when importing google_crc32c:

  File ".../secrets.py", line 9, in <module>
    import google_crc32c
  File ".../lib/python3.8/site-packages/google_crc32c/__init__.py", line 25, in <module>
    from google_crc32c import cext as impl
  File ".../lib/python3.8/site-packages/google_crc32c/cext.py", line 19, in <module>
    import google_crc32c.__config__  # type: ignore
  File ".../lib/python3.8/site-packages/google_crc32c/__config__.py", line 18, in <module>
    import pkg_resources
  File ".../lib/python3.8/site-packages/pkg_resources/__init__.py", line 121, in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)

You can reproduce the issue by importing google_crc32c in a script and running it with -Wall.

GergelyKalmar commented 1 year ago

The issue is triggered by the change introduced in setuptools 67.5.0 (https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6750).