klen / pylama

Code audit tool for python.
MIT License
1.05k stars 99 forks source link

python 3.12 removes pkg_resources #249

Open delfick opened 8 months ago

delfick commented 8 months ago

Hi,

It seems that pylama uses pkg_resources which does not exist after python 3.12

calebAtIspot commented 4 months ago

I ran into the same issue. https://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.

Relevant: https://github.com/mu-editor/mu/issues/2485

Looks like you might be able to work around it by installing setuptools, but given that this is deprecated pkg_resources should not be used and this is still a bug.

bersbersbers commented 4 months ago

The crazy thing is that pylama does not seem to depend on setuptools, so on 3.12, you can end up with a non-working installation of pylama if no other package depends on setuptools, as the bundled one has been removed (https://github.com/python/cpython/issues/95299).

bje- commented 3 months ago

I've submitted #254 that fixes these issues.