Comment 52 for bug 1991606

Revision history for this message
Steve Langasek (vorlon) wrote :

Stefano, thanks, that does feel much closer to a test case that models a real-world scenario.

The doubt I still have is, if you're pulling something as fundamental as setuptools from pip, why are you using virtualenv --system-site-packages at all? Is this because it's embedded in third-party code that's hard for the user to change?

This fails:

$ sudo apt install python3-virtualenv python3-distro-info
$ virtualenv --system-site-packages foo
$ foo/bin/python -m pip install -U setuptools
$ foo/bin/python -c "import pkg_resources; pkg_resources.require('distro-info')"

But this succeeds:

$ sudo apt install python3-virtualenv python3-distro-info
$ virtualenv --system-site-packages foo
$ foo/bin/python -m pip install -U setuptools
$ foo/bin/python -c "import pkg_resources; pkg_resources.require('filelock')"

as does this:

$ sudo apt install python3-virtualenv python3-distro-info
$ virtualenv --system-site-packages foo
$ foo/bin/python -m pip install -U setuptools distro-info
$ foo/bin/python -c "import pkg_resources; pkg_resources.require('distro-info')"

It's only when trying to use a setuptools newer than the one in the distro, with distro versions of specific python modules, that I can reproduce a failure. So, uh, why do that?