checksumdir
checksumdir copied to clipboard
Replaced pkg_resources with importlib.metadata
Use of pkg_resources is discouraged in favor of importlib.resources and importlib.metadata. importlib.metadata is used in this commit to get the version string from the pyproject.toml package configuration.
This PR closes #22 in order to hopefully allow PyOxidizer to package the library.
This will break compatibility in https://github.com/to-mc/checksumdir/blob/5c7a70327cbd8c767b72faa1e2ace2335c3feea5/pyproject.toml#L14
as importlib.metadata
is only available since Python 3.8. Older Python versions (like supported by this project) require using the backport in importlib-metadata
.
As already mentioned, just requiring importlib_metadata; python_version < "3.8"
(or dropping Python < 3.8 completely) and writing
try:
from importlib.metadata import version
except ImportError:
# Python < 3.8
from importlib_metadata import version
would fix this for every supported version since Python 3.6.