pytest-plugins icon indicating copy to clipboard operation
pytest-plugins copied to clipboard

pytest-virtualenv uses deprecated distutils

Open jaraco opened this issue 4 years ago • 2 comments

In https://github.com/pypa/setuptools/pull/2865#discussion_r746862098, I learned that pytest-virtualenv is importing distutils, which raises Warnings (treated as errors) in the Setuptools test suite when Setuptools is attempting to supply the distutils module. Distutils is deprecated in Python 3.10 and slated for removal in Python 3.12, so should be removed from this package.

jaraco avatar Nov 10 '21 19:11 jaraco

In https://github.com/pypa/setuptools/pull/2865#issuecomment-965700532, I learned the issue is more complicated on PyPy, because pytest-virtualenv imports pkg_resources, which implicitly loads the working set which triggers behavior of invoking sysconfig.get_platform(), which on PyPy imports distutils.spawn.

So to fully get rid of distutils import behavior including PyPy, one will also need to avoid pkg_resources.

jaraco avatar Nov 10 '21 20:11 jaraco

So grateful to see this being incorporated!

jaraco avatar Nov 19 '21 20:11 jaraco