Support Python 3.12
With Python 3.12 the following error is encountered:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.12.2/x64/bin/liccheck", line 5, in <module>
from liccheck.command_line import main
File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/liccheck/command_line.py", line 5, in <module>
from liccheck.requirements import parse_requirements, resolve, resolve_without_deps
File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/liccheck/requirements.py", line 1, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
https://github.com/dhatim/python-license-check/issues/114 covers the same error as a deprecation warning, but full support should be given to Python 3.12
This is quite the necessary upgrade if we want to keep using liccheck.
@rad-pat do you know what changes must be done, maybe you can point me to them? Then I can try to open a PR myself.
@albertodiazdorado , according to https://docs.python.org/3/whatsnew/3.12.html, pkg_resources should be available if setuptools is installed as requirement, which is essentially what https://github.com/dhatim/python-license-check/pull/113 is doing. I'm not sure why tests failed for that PR.
This warning suggests that relying on pkg_resources via setuptools may not be a lasting workaround. I get the warning when running liccheck in a project with Python 3.11.9 and an explicit dependency on setuptools
UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.