Package: release.debian.org Severity: normal Tags: bullseye User: release.debian....@packages.debian.org Usertags: pu
An easy bug fix in python-virtualenv on bullseye, for a bug in one of our patches. Already fixed in unstable, without any reported regressions. [ Reason ] This fails on bullseye, at the moment: $ virtualenv -p python3 --no-setuptools testve The patch fixes it. [ Impact ] While --no-setuptools is probably an unusual flag, a user filed the bug, so it's hitting people in the real world. [ Tests ] Autopkgtests pass. I manually tested the affected code. [ Risks ] Very minimal change. [ Checklist ] [x] *all* changes are documented in the d/changelog [x] I reviewed all changes and I approve them [x] attach debdiff against the package in (old)stable [x] the issue is verified as fixed in unstable [ Changes ] Avoid a KeyError in python by not looking up the key unless we've verified it's in the dict. [ Other info ] Uploaded to the queue.
diff -Nru python-virtualenv-20.4.0+ds/debian/changelog python-virtualenv-20.4.0+ds/debian/changelog --- python-virtualenv-20.4.0+ds/debian/changelog 2021-06-20 17:31:30.000000000 -0400 +++ python-virtualenv-20.4.0+ds/debian/changelog 2021-12-09 09:34:08.000000000 -0400 @@ -1,3 +1,10 @@ +python-virtualenv (20.4.0+ds-2+deb11u1) bullseye; urgency=medium + + * include-pkg_resources.patch: Avoid KeyError when building a virtualenv + with --no-setuptools, thanks Mathieu Parent. (Closes: #994953) + + -- Stefano Rivera <stefa...@debian.org> Thu, 09 Dec 2021 09:34:08 -0400 + python-virtualenv (20.4.0+ds-2) unstable; urgency=medium * Patch: Fix --upgrade-embed-wheels. diff -Nru python-virtualenv-20.4.0+ds/debian/patches/include-pkg_resources.patch python-virtualenv-20.4.0+ds/debian/patches/include-pkg_resources.patch --- python-virtualenv-20.4.0+ds/debian/patches/include-pkg_resources.patch 2021-06-20 17:31:30.000000000 -0400 +++ python-virtualenv-20.4.0+ds/debian/patches/include-pkg_resources.patch 2021-12-09 09:34:08.000000000 -0400 @@ -6,9 +6,9 @@ Forwarded: not-needed Last-Update: 2021-07-20 --- - src/virtualenv/seed/embed/pip_invoke.py | 9 ++++++++- - src/virtualenv/seed/embed/via_app_data/via_app_data.py | 9 ++++++++- - 2 files changed, 16 insertions(+), 2 deletions(-) + src/virtualenv/seed/embed/pip_invoke.py | 9 ++++++++- + src/virtualenv/seed/embed/via_app_data/via_app_data.py | 10 +++++++++- + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/virtualenv/seed/embed/pip_invoke.py b/src/virtualenv/seed/embed/pip_invoke.py index c935c02..275330b 100644 @@ -45,7 +45,7 @@ cmd.extend(["--find-links", str(folder)]) yield cmd diff --git a/src/virtualenv/seed/embed/via_app_data/via_app_data.py b/src/virtualenv/seed/embed/via_app_data/via_app_data.py -index 9a98a70..4d82594 100644 +index 9a98a70..9c879cc 100644 --- a/src/virtualenv/seed/embed/via_app_data/via_app_data.py +++ b/src/virtualenv/seed/embed/via_app_data/via_app_data.py @@ -10,7 +10,8 @@ from threading import Lock, Thread @@ -58,14 +58,15 @@ from virtualenv.util.path import Path from .pip_install.copy import CopyPipInstall -@@ -123,6 +124,12 @@ class FromAppData(BaseEmbed): +@@ -123,6 +124,13 @@ class FromAppData(BaseEmbed): thread.start() for thread in threads: thread.join() + + # Debian specific: Since Debian splits out pkg_resources from + # setuptools, for a local virtualenv, we need to add it to the base. -+ if name_to_whl['setuptools'].path.is_relative_to(BUNDLE_FOLDER): ++ if ('setuptools' in name_to_whl and ++ name_to_whl['setuptools'].path.is_relative_to(BUNDLE_FOLDER)): + _get('pkg_resources', Version.bundle) + if fail: