man-group / pytest-plugins

A grab-bag of nifty pytest plugins
MIT License
559 stars 83 forks source link

pytest-virtualenv uses deprecated distutils #188

Open jaraco opened 2 years ago

jaraco commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

So grateful to see this being incorporated!