Remove using `pkg_resources` package
Usage of pkg_resources
is deprecated, and no longer installed (by default) in python 3.12 (it's merged into setuptools
).
This causes problems when running g4camp
on python >3.11
We have options:
- Use
importlib.resources
as a drop-in replacement - Add
setuptools
to dependencies - We actually don't need the
pkg_resources
- it's used in lines https://git.jinr.ru/malyshkin/g4camp/-/blob/main/g4camp/g4camp.py#L5 just to check if thegeant4-pybind
can be imported. Why not use try-catch instead:
try:
from geant4_pybind import *
except:
sys.exit("Package 'geant4_pybind' is not available.")
I think the option 3 is the cleanest solution.
Edited by Andrey Sheshukov