Package: python3-virtualenv
Version: 20.17.1+ds-1
Severity: important
Hi,
as funny as the subject might sound, this took a while to track
down. :) Reporting this, since this might bite other folks as well,
and I also have STR.
The behavior that was present until and incl. bullseye was as
follows (newlines between command lines added by myself to make it
easier to read/parse/follow):
| % podman run --pull=always --rm -i -t debian:bullseye bash
| root@9b5d718485de:/# cd
| root@9b5d718485de:~# apt update ; apt -y install python3-virtualenv
| [...]
| root@9b5d718485de:~# virtualenv --python=python3 virtualenv
| created virtual environment CPython3.9.2.final.0-64 in 162ms
| creator CPython3Posix(dest=/root/virtualenv, clear=False,
no_vcs_ignore=False, global=False)
| seeder FromAppData(download=False, pip=bundle, setuptools=bundle,
wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
| added seed packages: pip==20.3.4, pkg_resources==0.0.0,
setuptools==44.1.1, wheel==0.34.2
| activators
BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
|
| root@9b5d718485de:~# . virtualenv/bin/activate
|
| (virtualenv) root@9b5d718485de:~# pip install python-debian
| Collecting python-debian
| Downloading python_debian-0.1.49-py3-none-any.whl (132 kB)
| || 132 kB 5.9 MB/s
| Collecting chardet
| Downloading chardet-5.1.0-py3-none-any.whl (199 kB)
| || 199 kB 18.4 MB/s
| Installing collected packages: chardet, python-debian
| Successfully installed chardet-5.1.0 python-debian-0.1.49
|
| (virtualenv) root@9b5d718485de:~# python3 -c "from debian import deb822"
|
| (virtualenv) root@9b5d718485de:~# virtualenv --python=python3 virtualenv
| created virtual environment CPython3.9.2.final.0-64 in 142ms
| creator CPython3Posix(dest=/root/virtualenv, clear=False,
no_vcs_ignore=False, global=False)
| seeder FromAppData(download=False, pip=bundle, setuptools=bundle,
wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
| added seed packages: chardet==5.1.0, pip==20.3.4, pkg_resources==0.0.0,
python_debian==0.1.49, setuptools==44.1.1, wheel==0.34.2
| activators
BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
|
| (virtualenv) root@9b5d718485de:~# python3 -c "from debian import deb822"
So everything fine, no problems.
But on bookworm, this doesn't behave as such any longer:
| % podman run --pull=always --rm -i -t debian:bookworm bash
| root@491ed520fc26:/# cd
| root@491ed520fc26:~# apt update ; apt -y install python3-virtualenv
| [...]
| root@491ed520fc26:~# virtualenv --python=python3 virtualenv
| created virtual environment CPython3.11.2.final.0-64 in 439ms
| creator CPython3Posix(dest=/root/virtualenv, clear=False,
no_vcs_ignore=False, global=False)
| seeder FromAppData(download=False, pip=bundle, setuptools=bundle,
wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
| added seed packages: pip==23.0.1, setuptools==66.1.1, wheel==0.38.4
| activators
BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
|
| root@491ed520fc26:~# . virtualenv/bin/activate
|
| (virtualenv) root@491ed520fc26:~# pip install python-debian
| Collecting python-debian
| Downloading python_debian-0.1.49-py3-none-any.whl (132 kB)
| 132.5/132.5 kB 3.7 MB/s eta
0:00:00
| Collecting chardet
| Downloading chardet-5.1.0-py3-none-any.whl (199 kB)
| 199.1/199.1 kB 6.5 MB/s eta
0:00:00
| Installing collected packages: chardet, python-debian
| Successfully installed chardet-5.1.0 python-debian-0.1.49
|
| (virtualenv) root@491ed520fc26:~# python3 -c "from debian import deb822"
|
| (virtualenv) root@491ed520fc26:~# virtualenv --python=python3 virtualenv
| created virtual environment CPython3.11.2.final.0-64 in 341ms
| creator CPython3Posix(dest=/root/virtualenv, clear=False,
no_vcs_ignore=False, global=False)
| seeder FromAppData(download=False, pip=bundle, setuptools=bundle,
wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
| added seed packages: chardet==5.1.0, pip==23.0.1, python_debian==0.1.49,
setuptools==66.1.1, wheel==0.38.4
| activators
BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
|
| (virtualenv) root@491ed520fc26:~# python3 -c "from debian import deb822"
| Traceback (most recent call last):
| File "", line 1, in
| ModuleNotFoundError: No module named 'debian'
So the re-execution of `virtualenv` for some reason removes the
debian directory of python-debian on the filesystem. :-/
To highlight this from another run:
| (virtualenv) root@b5d06fb7:~# ls
virtualenv/lib/python3.11/site-packages/debian
| __init__.py __pycache__ _arch_table.py _deb822_repro _util.py
_version.py