Replace pkg_resources with importlib.resources
limition lion uses pkg_resources here, we should use the new APIs from stdlib instead, as pkg_resources was deprecated.
From the pkg_resources docs: setuptools.pypa.io/en/latest/pkg_resources.html
Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.
We should start using something like
importlib.resources.files(__name__).joinpath('throttle.lua').read_text()
instead of
pkg_resources.resource_string(__name__, 'throttle.lua').decode()
Current workarounds
As a workaround if you need to use limitlion on Python 3.12 you can add setuptools to your requirements. Otherwise limitlion already works on Python 3.12.
Follow ups
While at it we should also:
- declare minimal version of supported Python to 3.9.
- Add 3.11 and 3.12 to the test suite and remove 3.8
- Update Trove classifiers in setup.py to reflect supported Python versions
- Release new version
- Update dependent projects
- Remove setuptools depedency from requirements where appropriate, for example in sync-engine