🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #614

Bug#1150720: dh-virtualenv: bin/activate keeps the build directory with recent venv and virtualenv

#614
From: Nico Della Torre
Date: Mon, 12 Oct 2026 18:10
47 lines
3299 bytes
Package: dh-virtualenv
Version: 1.2.2-3
Severity: normal

dh_virtualenv rewrites the VIRTUAL_ENV assignments in bin/activate,
bin/activate.csh and bin/activate.fish with regular expressions anchored
at the start of the line (^VIRTUAL_ENV=, ^setenv VIRTUAL_ENV,
^set -gx VIRTUAL_ENV).

Recent versions of venv (Python >= 3.12) and virtualenv (>= 20.36)
indent the assignment in bin/activate inside a case or if block, so it
is no longer matched and the installed script still points to the build
directory, e.g.:

    VIRTUAL_ENV=/build/foo/debian/foo/opt/venvs/foo

With virtualenv 21.5.1 in unstable, sourcing the installed
/opt/venvs/foo/bin/activate prints

    Virtual environment directory /build/foo/debian/foo/opt/venvs/foo does not exist!

and python from the virtualenv is not put in PATH. The csh and fish
patterns also match the VIRTUAL_ENV_PROMPT lines and overwrite them with
the VIRTUAL_ENV assignment.

Steps to reproduce: build any package with
"dh $@ --with python-virtualenv", install it and source
/opt/venvs/<package>/bin/activate in bash.

Replacing the build path of the virtualenv in all the bin/activate*
scripts, instead of matching each assignment, works for every shell and
script layout.



-- System Information:
Debian Release: forky/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 7.2.9+deb14-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE=it
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Technical Details
Message-ID: <NNsDg-57qB-7@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Nico Della Torre <nicoz91@ubuntu.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1150720: dh-virtualenv: bin/activate keeps the build directory with recent venv and virtualenv
Date: Mon, 12 Oct 2026 20:10:02 +0200
Message-ID: <NNsDg-57qB-7@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Oct 12 18:08:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.651
Reply-To: Nico Della Torre <nicoz91@ubuntu.com>, 1150720@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: team+python@tracker.debian.org
X-Debian-Pr-Message: report 1150720
X-Debian-Pr-Package: dh-virtualenv
X-Debian-Pr-Source: dh-virtualenv
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0+nmu1
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1996441
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 47
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 12 Oct 2026 20:06:12 +0200
X-Original-Message-ID: <179182837270.89431.443818934977783638.reportbug@ryzendeb.linuxlab>