Closed ldallmayr closed 10 months ago
The resources.files api was introduced in Python 3.9, therefore I had to use the function resources.read_text. This function has been marked deprecated since Python 3.11. As soon as the minimum requirement for prospector is Python 3.9 one could change to the resources.files api.
importlib.metadata was introduced in Python 3.8, so either the backports of those tools have to be used or this change has to be postponed until the minimum requirement is greater than Python 3.8
Python 3.9 is not yet EOL, we should probably use both with a if sys.version_info(...)
guard until then.
Description
The use of pkg_resources is deprecated in favor of its importlib equivalents. Running the pre-commit hook with Python 3.12 fails because pkg_resources cannot be found.
ModuleNotFoundError: No module named 'pkg_resources'
Related Issue
https://github.com/landscapeio/prospector/issues/646
Motivation and Context
This pull request fixes the error
ModuleNotFoundError: No module named 'pkg_resources'
when ran by pre-commitHow Has This Been Tested?
Ran all tests with pytest locally
Failed tests
Types of changes
Checklist: