Closed neteler closed 2 years ago
The most pressing issue in g.extension.py should be solved in #2592.
Looks like we could replace from distutils.spawn import find_executable
with from shutil import which
.
Regarding the addon, there is no clear replacement in standard library, there are external packages like https://pypi.org/project/looseversion/, but maybe it could be solved by manual parsing/comparison of the versions.
https://github.com/OSGeo/grass/pull/1158 has now been updated accordingly...
Version-comparison in the addon could also be done "manually" with splitting the version string and extracting a major and minor integer, no?
Now, distutils is only imported for older Python versions: https://github.com/OSGeo/grass/search?q=distutils
So the issue can be considered fixed.
Describe the bug
In Python 3.10 and 3.11,
distutils
will be formally marked as deprecated. Code that importsdistutils
will no longer work from Python 3.12.The suggested migration path is to use the equivalent (though not identical) imports from setuptools (see [5]), or to migrate to an alternative build backend (see PEP 517).
For details, see https://peps.python.org/pep-0632/
Code scanning
GRASS GIS core:
GRASS-addons:
Why relevant?
GRASS GIS will no longer compile in future Fedora (and other distros): See e.g. here: https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/N6ITYHLRWIDNYNXGPYG2ZHF3ZLQWZN7L/