-
-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace pkg_resources.require() with a new implementation
pkg_resources is deprecated and, under some circumstances, causes import errors in Python 3.12. This commit replaces the one remaining function from pkg_resources, the require() function, with a new implementation that does the same thing. It was necessary to implement the function anew because there's no equivalent for require() in the packaging or importlib.* modules. There is an implementation in the hbutils package, but I didn't think it was worth bringing in a new dependency for just this one function. https://hansbug.github.io/hbutils/main/api_doc/system/python.html#check-reqs See also pypa/packaging-problems#664 This new implementation is based most closely on the original pkg_resources code.
- Loading branch information
Showing
1 changed file
with
110 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters