pypa / virtualenv

Virtual Python Environment builder
https://virtualenv.pypa.io
MIT License
4.79k stars 1.03k forks source link

Cache is not invalidated if PythonInfo is changed #2467

Open JanLuca opened 1 year ago

JanLuca commented 1 year ago

Issue

For example in the commit https://github.com/pypa/virtualenv/commit/445a68dffa7ba5c0af3b02ec0545b760cd8c04ba it was fixed that the venv prefix on Debian systems with 3.10 includes a wrong "local" prefix. But since virtualenv caches the PythonInfo class on disk if it called with a specific executable (e.g. poetry specifies a specific exe), it can happen that broken information is provided for the virtual env creation.

The package should include a mechanism to invalidate the cache data if the internals of the PythonInfo changes.

Environment

Provide at least:

$ pip list
Package                            Version
---------------------------------- -------------------------
appdirs                            1.4.4
argon2-cffi                        21.1.0
asn1crypto                         1.5.1
astroid                            2.12.13
asttokens                          2.2.0
async-generator                    1.10
attrs                              22.1.0
Babel                              2.10.3
backcall                           0.2.0
beautifulsoup4                     4.11.1
beniget                            0.4.1
black                              22.10.0
bleach                             5.0.1
borgbackup                         1.2.2
Brotli                             1.0.9
build                              0.7.0
bytecode                           0.14.0
certifi                            2022.9.24
chardet                            5.1.0
charset-normalizer                 3.0.1
click                              8.1.3
colorama                           0.4.6
coverage                           6.5.0
cryptography                       38.0.4
cupshelpers                        1.0
cycler                             0.11.0
dbus-python                        1.3.2
debugpy                            1.6.3+git20221103.a2a3328
decorator                          5.1.1
defusedxml                         0.7.1
dill                               0.3.6
distlib                            0.3.6
distro                             1.8.0
distro-info                        1.2
entrypoints                        0.4
exceptiongroup                     1.0.4
executing                          1.2.0
fastjsonschema                     2.15.1
filelock                           3.8.2
flake8                             5.0.4
fonttools                          4.37.4
fs                                 2.4.16
gast                               0.5.2
html5lib                           1.1
httplib2                           0.20.4
idna                               3.3
importlib-metadata                 4.12.0
iotop                              0.6
ipykernel                          6.17.0
ipython                            8.5.0
ipython_genutils                   0.2.0
ipywidgets                         6.0.0
isort                              5.6.4
jedi                               0.18.0
Jinja2                             3.0.3
jsonpointer                        2.3
jsonschema                         4.9.1
jupyter-client                     7.3.4
jupyter-console                    6.4.4
jupyter_core                       4.12.0
jupyterlab-pygments                0.2.2
kiwisolver                         1.3.2
lazy-object-proxy                  1.7.1
libevdev                           0.5
llfuse                             1.4.1
logilab-common                     1.9.7
lxml                               4.9.1
lz4                                4.0.2+dfsg
Mako                               1.2.4.dev0
Markdown                           3.4.1
MarkupSafe                         2.1.1
matplotlib                         3.5.2
matplotlib-inline                  0.1.6
mccabe                             0.7.0
mechanize                          0.4.8
mensapy                            0.3.0
more-itertools                     8.10.0
mpmath                             0.0.0
msgpack                            1.0.3
mypy                               0.991
mypy-extensions                    0.4.3
nbclient                           0.7.0
nbconvert                          6.5.3
nbformat                           5.5.0
nest-asyncio                       1.5.4
netifaces                          0.11.0
notebook                           6.4.12
numpy                              1.23.5
olefile                            0.46
outcome                            1.2.0
packaging                          22.0
pandocfilters                      1.5.0
parso                              0.8.3
pathspec                           0.10.1
pep517                             0.12.0
pexpect                            4.8.0
pickleshare                        0.7.5
Pillow                             9.2.0
pip                                22.3.1
platformdirs                       2.6.0
ply                                3.11
prometheus-client                  0.9.0
prompt-toolkit                     3.0.36
protobuf                           4.21.12
psutil                             5.9.4
ptyprocess                         0.7.0
pure-eval                          0.0.0
py                                 1.11.0
pycairo                            1.20.1
pycodestyle                        2.9.1
pycups                             2.0.1
pycurl                             7.45.1
pydevd                             2.9.2
pyflakes                           2.5.0
pyfuse3                            3.2.1
Pygments                           2.13.0
PyGObject                          3.42.2
pylint                             2.15.8
pyparsing                          3.0.9
pyrsistent                         0.18.1
PySimpleSOAP                       1.16.2
pysmbc                             1.0.23
python-apt                         2.5.0
python-dateutil                    2.8.2
python-debian                      0.1.49
python-debianbts                   4.0.1
pythran                            0.11.0
pytz                               2022.6
pyudev                             0.24.0
PyYAML                             6.0
pyzmq                              24.0.1
reportbug                          11.6.0
reportlab                          3.6.11
requests                           2.28.1
rfc3987                            1.3.8
SciPy                              1.8.1
Send2Trash                         1.8.1b0
setuptools                         65.5.0
six                                1.16.0
sniffio                            1.2.0
sortedcontainers                   2.4.0
soupsieve                          2.3.2
stack-data                         0.6.2
sympy                              1.11.1
terminado                          0.17.0
tinycss2                           1.2.1
toml                               0.10.2
tomli                              2.0.1
tomlkit                            0.11.6
tornado                            6.2
traitlets                          5.5.0
trio                               0.22.0
types-aiofiles                     22.1
types-annoy                        1.17
types-appdirs                      1.4
types-aws-xray-sdk                 2.10
types-babel                        2.11
types-backports.ssl-match-hostname 3.7
types-beautifulsoup4               4.11
types-bleach                       5.0
types-boto                         2.49
types-braintree                    4.17
types-cachetools                   5.2
types-caldav                       0.10
types-certifi                      2021.10.8
types-cffi                         1.15
types-chardet                      5.0
types-chevron                      0.14
types-click-spinner                0.1
types-colorama                     0.4
types-commonmark                   0.9
types-console-menu                 0.7
types-contextvars                  2.4
types-croniter                     1.3
types-cryptography                 3.3
types-D3DShot                      0.1
types-dateparser                   1.1
types-DateTimeRange                1.2
types-decorator                    5.1
types-Deprecated                   1.2
types-dj-database-url              1.0
types-docopt                       0.6
types-docutils                     0.19
types-editdistance                 0.6
types-emoji                        2.1
types-entrypoints                  0.4
types-first                        2.0
types-flake8-2020                  1.7
types-flake8-bugbear               22.10.27
types-flake8-builtins              2.0
types-flake8-docstrings            1.6
types-flake8-plugin-utils          1.3
types-flake8-rst-docstrings        0.2
types-flake8-simplify              0.19
types-flake8-typing-imports        1.14
types-Flask-Cors                   3.0
types-Flask-SQLAlchemy             2.5
types-fpdf2                        2.5
types-gdb                          12.1
types-google-cloud-ndb             1.11
types-hdbcli                       2.14
types-html5lib                     1.1
types-httplib2                     0.21
types-humanfriendly                10.0
types-invoke                       1.7
types-JACK-Client                  0.5
types-jmespath                     1.0
types-jsonschema                   4.17
types-keyboard                     0.13
types-ldap3                        2.9
types-Markdown                     3.4
types-mock                         4.0
types-mypy-extensions              0.4
types-mysqlclient                  2.1
types-oauthlib                     3.2
types-openpyxl                     3.0
types-opentracing                  2.4
types-paho-mqtt                    1.6
types-paramiko                     2.11
types-parsimonious                 0.10
types-passlib                      1.7
types-passpy                       1.0
types-peewee                       3.15
types-pep8-naming                  0.13
types-Pillow                       9.3
types-playsound                    1.3
types-polib                        1.1
types-prettytable                  3.4
types-protobuf                     3.20
types-psutil                       5.9
types-psycopg2                     2.9
types-pyaudio                      0.2
types-PyAutoGUI                    0.9
types-pycurl                       7.45
types-pyfarmhash                   0.3
types-pyflakes                     2.5
types-Pygments                     2.13
types-pyinstaller                  5.6
types-PyMySQL                      1.0
types-pynput                       1.7
types-pyOpenSSL                    22.1
types-pyRFC3339                    1.1
types-PyScreeze                    0.1
types-pysftp                       0.2
types-pytest-lazy-fixture          0.6
types-python-crontab               2.6
types-python-dateutil              2.8
types-python-gflags                3.1
types-python-jose                  3.3
types-python-nmap                  0.7
types-python-slugify               6.1
types-pytz                         2022.6
types-pyvmomi                      7.0
types-pywin32                      304
types-PyYAML                       6.0
types-redis                        4.3
types-regex                        2022.10.31
types-requests                     2.28
types-retry                        0.9
types-Send2Trash                   1.8
types-setuptools                   65.5
types-simplejson                   3.17
types-singledispatch               3.7
types-six                          1.16
types-slumber                      0.7
types-SQLAlchemy                   1.4.43
types-stdlib-list                  0.8
types-stripe                       3.5
types-tabulate                     0.9
types-termcolor                    1.1
types-toml                         0.10
types-toposort                     1.7
types-tqdm                         4.64
types-tree-sitter                  0.20
types-tree-sitter-languages        1.5
types-ttkthemes                    3.2
types-typed-ast                    1.5
types-tzlocal                      4.2
types-ujson                        5.5
types-urllib3                      1.26
types-vobject                      0.9
types-waitress                     2.1
types-whatthepatch                 1.0
types-xmltodict                    0.13
types-xxhash                       3.0
types-zxcvbn                       4.4
typing_extensions                  4.3.0
ufoLib2                            0.13.1
unattended-upgrades                0.1
unicodedata2                       15.0.0
uritemplate                        4.1.1
urllib3                            1.26.12
virtualenv                         20.17.1+ds
wcwidth                            0.2.5
webcolors                          1.11.1
webencodings                       0.5.1
wheel                              0.38.4
widgetsnbextension                 2.0.0
wrapt                              1.14.1
zipp                               1.0.0
gaborbernat commented 1 year ago

Pr welcome to fix this.