hdf5plugin icon indicating copy to clipboard operation
hdf5plugin copied to clipboard

Remove dependency on `distutils`

Open t20100 opened this issue 2 years ago • 1 comments

hdf5plugin packaging relies on setuptools and distutils, the later being deprecated.

As of today, some of the feature used from distutils are not available from setuptools, for instance: from distutils import ccompiler, error

It might be worth checking if meson suits our needs.

t20100 avatar Oct 21 '22 15:10 t20100

cmake-python-distributions is also worth checking since some of the embedded projects are using cmake.

t20100 avatar Nov 08 '22 14:11 t20100

setuptools is in fact including its own copy of distutils

As far as I have understood, if you import setuptools before importing anything from distutils, the internal copy of setuptools is used.

vasole avatar Dec 16 '22 11:12 vasole

setuptools is in fact including its own copy of distutils

As far as I have understood, if you import setuptools before importing anything from distutils, the internal copy of setuptools is used.

That's not a solution -- in fact, it's part of the problem.

If you're relying on distutils APIs, then even on python 3.11, which has distutils in the stdlib, setuptools installs an injection hook that makes python -c "import distutils; print(distutils)" show that distutils is ..../site-packages/setuptools/_distutils/__init__.py

And setuptools does NOT want you to import from distutils. Doing so is deprecated, and they are developing their vendored distutils with the goal of fixing issues in it by... changing the API. Or deprecating things they don't think people are using, even if they turn out to be using it.

eli-schwartz avatar Dec 18 '22 07:12 eli-schwartz

I 'm closing this issue: Current main only imports distutils as a fallback for old versions of setuptools (<62.4).

t20100 avatar Nov 07 '23 10:11 t20100