Speed up imports by using importlib instead of pkg_resources
Description
Speed up imports by up to a second by replacing uses of
pkg_resources
with the new Python standard library module
importlib.resources
(or, for Python < 3.7, the backport
importlib_resources
). The old pkg_resources
module is known to be
slow because it does a lot of work on startup.
See, for example, pypa/setuptools#926 and pypa/setuptools#510.
API Changes and Justification
Backwards Compatible Changes
-
This change introduces no API changes -
This change adds new API calls
Backwards Incompatible Changes
-
This change modifies an existing API -
This change removes an existing API
If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.
Review Status
Please provide details on any reviews related to this change and and the associated reviewers.
Edited by Ghost User