Closed dalito closed 8 months ago
The "real" fix seems to be using importlib as described here: https://setuptools.pypa.io/en/latest/pkg_resources.html
Hi @dalito thanks for the bug report.
While reading this, I was thinking "I'm sure setuptools was listed as a dependency", and I found this PR from last year that removed the distutils
dependency and moved to packaging
but there was no mention of setuptools
.
I suppose I mistakenly thought the pkg_resources
module came with distutils
but didn't think to check it when it was replaced with packaging
. But in reality I was relying on every system install and venv environment having setuptools
installed by default.
The importlib.resources module introduced in Python 3.7 seems like it will be a suitable replacement. I couldn't use that when I wrote this feature because PySHACL targeted Python 3.6 back then, but now Python 3.7 is the minimum, it should be fine to use.
@dalito thanks for your patience on this, the new version with this fix is out now. Note, PySHACL still does not officially support python 3.12, and the application is not tested on python 3.12, so if you're using 3.12 you may run into other issues.
pyshacl uses pkg_resources which comes with setuptools, e.g. here. For a long time setuptools was a given in virtual environments but it is not anymore and should be explicitly specified.
Typical traceback :