Skip to content

Replace the use of pkg_resources with importlib.metadata #2840

@webknjaz

Description

@webknjaz

Hello, using pkg_resources in gunicorn.util causes a deprecation warning to be issued down the stack (it's coming from sre_constants imported py the vendored pyparsing).

The use of pkg_resources has been heavily discouraged over the past years and nowadays the recommended alternative exists. It's called importlib.metadata and it's present in the modern CPython stdlib. For older interpreter versions, there's also an importlib_metadata backport packaged and published separately to PyPI. It can be used as a fallback.

https://importlib-metadata.readthedocs.io/en/latest/api.html#importlib_metadata.entry_points

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions