[Bug 1904945] Re: New virtualenvs contain unwanted libraries
Sorry I missed that regression, it's tracked in bug 1935882. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
The change to use sys.base_prefix has caused a regression in at least one python snap (Charmcraft). The effect of this change caused core20 python snaps to now revert to using '/usr' base_prefix when looking for wheels rather than the virtual environment root, effectively $SNAP. For example: >>> sys.prefix '/snap/charmcraft/x1' >>> sys.base_prefix '/usr' This prevented wheels from inside the snap from being loaded. We worked around this using a snap layout in a strict snap to put the python wheels in the newly expected location. For example: ``` layout: /usr/share/python-wheels: bind: $SNAP/share/python-wheels ``` I wonder if it really should even be loading the host's wheels when inside a virtual env? With `python3 -m venv` the wheels appear to be copied into the virtual env. `virtualenv` seems to ship its own embedded variants. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
This bug was fixed in the package python-pip - 20.0.2-5ubuntu1.3 --- python-pip (20.0.2-5ubuntu1.3) focal; urgency=medium * Add Breaks: python3-virtualenv (<< 20.0.17-1ubuntu0.3) to python-pip-whl, which bumps the seed-app-data version. Our LP: #1880749 change broke existing seed-app-data caches. python-pip (20.0.2-5ubuntu1.2) focal; urgency=medium * Switch from vendoring pytoml to toml, following pep517's dependency. (LP: #1880749) * Use sys.base_prefix instead of sys.prefix in debundle.patch. Back-ported from 20.1-1 to allow virtualenvs to avoid needing to install pip's dependencies in new venvs. (LP: #1904945) -- Stefano Rivera Fri, 26 Feb 2021 18:38:56 -0800 ** Changed in: python-pip (Ubuntu Focal) Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
LGTM, verification-done. ** Tags removed: verification-needed verification-needed-focal ** Tags added: verification-done verification-done-focal -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
** Changed in: python-pip (Ubuntu) Importance: Undecided => Medium ** Changed in: python-pip (Ubuntu Focal) Importance: Undecided => Medium ** Changed in: python-virtualenv (Ubuntu) Importance: Undecided => Medium ** Changed in: python-virtualenv (Ubuntu Focal) Importance: Undecided => Medium -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
Hello mimosomal, or anyone else affected, Accepted python-virtualenv into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python- virtualenv/20.0.17-1ubuntu0.2 in a few hours, and then in the -proposed repository. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed- focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification- failed-focal. In either case, without details of your testing we will not be able to proceed. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping! N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days. ** Changed in: python-virtualenv (Ubuntu Focal) Status: Confirmed => Fix Committed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
** Patch added: "python-virtualenv_20.0.17-1ubuntu0.2.debdiff" https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+attachment/5462002/+files/python-virtualenv_20.0.17-1ubuntu0.2.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
** Patch added: "python-virtualenv_20.0.17-1ubuntu0.2.incremental.debdiff" https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+attachment/5462003/+files/python-virtualenv_20.0.17-1ubuntu0.2.incremental.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
Corrected the dependency -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
Whoops, looks like a typo, that should have been python-pip-whl, not python3-pip -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
Ok, so looking at the python3-virtualenv change for this SRU - this now adds a completely new dependency to the python3-virtualenv package. From what I see it never depended on python3-pip before. I know it is a dependency for groovy+, but is it really required for every venv package installation? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
Hello mimosomal, or anyone else affected, Accepted python-pip into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python- pip/20.0.2-5ubuntu1.2 in a few hours, and then in the -proposed repository. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed- focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification- failed-focal. In either case, without details of your testing we will not be able to proceed. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping! N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days. ** Changed in: python-pip (Ubuntu Focal) Status: New => Fix Committed ** Tags added: verification-needed verification-needed-focal -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
** Description changed: + [Impact] + + * Virtualenvs created on Ubuntu 20.04 are not as empty as they are +expected to be. They are expected to contain pip and setuptools. +But the way pip's vendored dependencies were de-vendored resulted +in the libraries being exposed in the new virtualenv. +This was a side-effect of packaging the (rewritten) virtualenv 20. +It should have been resolved pre-release, but wasn't. + + * The behaviour is radically different to upstream virtualenv and +not what was expected by Python developers. + + [Test Case] + + # apt install python3 virtualenv + $ virtualenv -p python3 foo + $ foo/bin/python -m pip freeze + Should output nothing. In Ubuntu 20.04, it lists 24 packages. + + [Where problems could occur] + + * Anyone who has discovered this change and now expects it will be in +for a surprise. I'd expect this to be rare, as there are workarounds +instead (e.g. venv or upstream virtualenv). + * The patch could have issues too. It is close to what is currently in +Debian unstable & later Ubuntu releases, and seems to be working +correctly. + + [Other Info] + + * See also LP: #1880749 which is fixed in the same patch. + + [Original Report] + Since updating to ubuntu 20.04, whenever I create a virtual environment with `virtualenv` it contains many unwanted libraries. Unsetting PYTHONPATH, setting the `--python` flag to a different version, etc does not fix the issue. I could run it with `--no-seed` but then the new venv doesn't even have pip. I found another user who has the exact same issue posting about it on stackoverflow and the list of packages which were installed by default is the same, this leads me to believe that something is wrong with the package itself and not a local config issue. `https://stackoverflow.com/q/62991007/5953826` - This is the output from creating a virtualenv: ``` ➜ virtualenv --python=/usr/bin/python3.8 ~/projects/environments/test created virtual environment CPython3.8.5.final.0-64 in 156ms - creator CPython3Posix(dest=/home/redacted/projects/environments/test, clear=False, global=False) - seeder FromAppData(download=False, urllib3=latest, contextlib2=latest, idna=latest, ipaddr=latest, colorama=latest, pkg_resources=latest, webencodings=latest, pip=latest, progress=latest, setuptools=latest, retrying=latest, certifi=latest, chardet=latest, appdirs=latest, msgpack=latest, html5lib=latest, pytoml=latest, pyparsing=latest, distro=latest, CacheControl=latest, distlib=latest, pep517=latest, lockfile=latest, requests=latest, packaging=latest, six=latest, wheel=latest, via=copy, app_data_dir=/home/redacted/.local/share/virtualenv/seed-app-data/v1.0.1.debian) - activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator + creator CPython3Posix(dest=/home/redacted/projects/environments/test, clear=False, global=False) + seeder FromAppData(download=False, urllib3=latest, contextlib2=latest, idna=latest, ipaddr=latest, colorama=latest, pkg_resources=latest, webencodings=latest, pip=latest, progress=latest, setuptools=latest, retrying=latest, certifi=latest, chardet=latest, appdirs=latest, msgpack=latest, html5lib=latest, pytoml=latest, pyparsing=latest, distro=latest, CacheControl=latest, distlib=latest, pep517=latest, lockfile=latest, requests=latest, packaging=latest, six=latest, wheel=latest, via=copy, app_data_dir=/home/redacted/.local/share/virtualenv/seed-app-data/v1.0.1.debian) + activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator ``` And these exact package versions are what get installed by default. ``` appdirs==1.4.3 CacheControl==0.12.6 certifi==2019.11.28 chardet==3.0.4 colorama==0.4.3 contextlib2==0.6.0 distlib==0.3.0 distro==1.4.0 html5lib==1.0.1 idna==2.8 ipaddr==2.2.0 lockfile==0.12.2 msgpack==0.6.2 packaging==20.3 pep517==0.8.2 progress==1.5 pyparsing==2.4.6 pytoml==0.1.21 requests==2.22.0 retrying==1.3.3 six==1.14.0 urllib3==1.25.8 webencodings==0.5.1 ``` All of the packages above are in the folder `~/.local/share/virtualenv /seed-app-data/v1.0.1.debian/3.8/wheels`, but removing ~/.local/share/virtualenv/seed-app-data does not fix the issue. It is recreated with the same packages. Creating a venv with `python3 -m venv path/to/venv` gives me a clean environment with no extra packages which is my current workaround. System Info: lsb_release -rd Description: Ubuntu 20.04.1 LTS Release: 20.04 - apt-cache policy python3-virtualenv + apt-cache policy python3-virtualenv python3-virtualenv: - Installed: 20.0.17-1 - Candidate: 20.0.17-1 - Version table: - *** 20.0.17-1 500 - 500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages - 500 http://us.archive.ubuntu.com/ubuntu focal/universe
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
** Patch added: "python-virtualenv_20.0.17-1ubuntu0.1.debdiff" https://bugs.launchpad.net/ubuntu/+source/python-virtualenv/+bug/1904945/+attachment/5457224/+files/python-virtualenv_20.0.17-1ubuntu0.1.debdiff ** Also affects: python-pip (Ubuntu) Importance: Undecided Status: New ** Changed in: python-pip (Ubuntu) Status: New => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
** Patch added: "python-pip_20.0.2-5ubuntu1.2.debdiff" https://bugs.launchpad.net/ubuntu/+source/python-virtualenv/+bug/1904945/+attachment/5457223/+files/python-pip_20.0.2-5ubuntu1.2.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
Let's use the right syntax for a link: LP: #1880749 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-virtualenv/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1904945] Re: New virtualenvs contain unwanted libraries
The issue is a result of devendoring the pip dependencies. See the discussion in #1880749. It was improved in Ubuntu 20.10, but too late for Focal. ** Also affects: python-virtualenv (Ubuntu Focal) Importance: Undecided Status: New ** Changed in: python-virtualenv (Ubuntu) Status: New => Fix Released ** Changed in: python-virtualenv (Ubuntu Focal) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1904945 Title: New virtualenvs contain unwanted libraries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-virtualenv/+bug/1904945/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs