Skip to content

Obviate pkg_resources through suitable replacements

No due date 66% complete

pkg_resources has some undesirable behaviors that are difficult to disentangle from some of its essential functions. In particular, on import, pkg_resources performs a scan of the path and assembles a working set of packages. This behavior has a high cost in some environments.

Alternatives have emerged for some of the use-cases, including entrypoints, imp…

pkg_resources has some undesirable behaviors that are difficult to disentangle from some of its essential functions. In particular, on import, pkg_resources performs a scan of the path and assembles a working set of packages. This behavior has a high cost in some environments.

Alternatives have emerged for some of the use-cases, including entrypoints, importlib_resources, and importlib_metadata, some of which are included or slated to be included in the stdlib.

Although there were once plans to extract pkg_resources into a separate library, the bootstrapping challenges and possibility of dependency on the implicit behavior on import make that a challenging prospect. Instead, setuptools should work to direct users to these alternative solutions and identify unsupported use-cases and shore up those use-cases in the alternative solutions.

Loading