Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOX_OVERRIDE=testenv.pass_env=+FOO drops config values from testenv.passenv in tox.ini #3348

Open
vlotorev opened this issue Sep 21, 2024 · 0 comments

Comments

@vlotorev
Copy link

vlotorev commented Sep 21, 2024

Issue

Create tox.ini with contents:

$ cat tox.ini
[testenv]
passenv = FOO

This output matches expected - FOO var is present in pass_env:

$ tox config -k pass_env | grep --extended-regexp 'FOO|BAR'
  FOO

This output matches expected - both FOO and BAR in pass_env:

$ TOX_OVERRIDE=testenv.passenv+=BAR tox config -k pass_env | grep --extended-regexp 'FOO|BAR'
  BAR
  FOO

This output doesn't match expected - only BAR is present, but FOO from tox.ini is missing (note that TOX_OVERRIDE is using pass_env, tox.ini declares passenv):

$ TOX_OVERRIDE=testenv.pass_env+=BAR tox config -k pass_env | grep --extended-regexp 'FOO|BAR'
  BAR

Environment

  • OS: CentOS Stream 9
$ pip list
Package       Version
------------- -------
cachetools    5.5.0
chardet       5.2.0
colorama      0.4.6
distlib       0.3.8
filelock      3.16.1
packaging     24.1
pip           23.2.1
platformdirs  4.3.6
pluggy        1.5.0
pyproject-api 1.8.0
tox           4.20.0
virtualenv    20.26.5

Output of running tox

Output of tox -rvv
$ tox -rvv
py: 90 W remove tox env folder /home/vlotorev/tmp/tox/.tox/py [tox/tox_env/api.py:324]
py: 94 I find interpreter for spec PythonSpec(path=/home/vlotorev/tmp/tox/venv/bin/python3.12) [virtualenv/discovery/builtin.py:72]
py: 94 D filesystem is case-sensitive [virtualenv/info.py:25]
py: 95 D got python info of %s from (PosixPath('/usr/bin/python3.12'), PosixPath('/home/vlotorev/.local/share/virtualenv/py_info/1/f0d7a494a3f776233427cb85a7e198c7cf4913b50a203c6febc678cc4f5bf265.json')) [virtualenv/app_data/via_disk_folder.py:131]
py: 95 I proposed PythonInfo(spec=CPython3.12.1.final.0-64, system=/usr/bin/python3.12, exe=/home/vlotorev/tmp/tox/venv/bin/python3.12, platform=linux, version='3.12.1 (main, Feb 19 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:79]
py: 95 D accepted PythonInfo(spec=CPython3.12.1.final.0-64, system=/usr/bin/python3.12, exe=/home/vlotorev/tmp/tox/venv/bin/python3.12, platform=linux, version='3.12.1 (main, Feb 19 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:81]
py: 108 I create virtual environment via CPython3Posix(dest=/home/vlotorev/tmp/tox/.tox/py, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:50]
py: 109 D create folder /home/vlotorev/tmp/tox/.tox/py/bin [virtualenv/util/path/_sync.py:12]
py: 109 D create folder /home/vlotorev/tmp/tox/.tox/py/lib/python3.12/site-packages [virtualenv/util/path/_sync.py:12]
py: 109 D create folder /home/vlotorev/tmp/tox/.tox/py/lib64/python3.12/site-packages [virtualenv/util/path/_sync.py:12]
py: 109 D write /home/vlotorev/tmp/tox/.tox/py/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:33]
py: 109 D       home = /usr/bin [virtualenv/create/pyenv_cfg.py:38]
py: 109 D       implementation = CPython [virtualenv/create/pyenv_cfg.py:38]
py: 109 D       version_info = 3.12.1.final.0 [virtualenv/create/pyenv_cfg.py:38]
py: 109 D       virtualenv = 20.26.5 [virtualenv/create/pyenv_cfg.py:38]
py: 109 D       include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:38]
py: 109 D       base-prefix = /usr [virtualenv/create/pyenv_cfg.py:38]
py: 109 D       base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:38]
py: 109 D       base-executable = /usr/bin/python3.12 [virtualenv/create/pyenv_cfg.py:38]
py: 109 D symlink /usr/bin/python3.12 to /home/vlotorev/tmp/tox/.tox/py/bin/python [virtualenv/util/path/_sync.py:32]
py: 109 D create virtualenv import hook file /home/vlotorev/tmp/tox/.tox/py/lib/python3.12/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:91]
py: 110 D create /home/vlotorev/tmp/tox/.tox/py/lib/python3.12/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:94]
py: 110 D ============================== target debug ============================== [virtualenv/run/session.py:52]
py: 110 D debug via /home/vlotorev/tmp/tox/.tox/py/bin/python /home/vlotorev/tmp/tox/venv/lib64/python3.12/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:200]
py: 110 D {
  "sys": {
    "executable": "/home/vlotorev/tmp/tox/.tox/py/bin/python",
    "_base_executable": "/usr/bin/python3.12",
    "prefix": "/home/vlotorev/tmp/tox/.tox/py",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/home/vlotorev/tmp/tox/.tox/py",
    "base_exec_prefix": "/usr",
    "path": [
      "/usr/lib64/python312.zip",
      "/usr/lib64/python3.12",
      "/usr/lib64/python3.12/lib-dynload",
      "/home/vlotorev/tmp/tox/.tox/py/lib64/python3.12/site-packages",
      "/home/vlotorev/tmp/tox/.tox/py/lib/python3.12/site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "utf-8"
  },
  "version": "3.12.1 (main, Feb 19 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]",
  "makefile_filename": "/usr/lib64/python3.12/config-3.12-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' (frozen)>",
  "site": "<module 'site' (frozen)>",
  "datetime": "<module 'datetime' from '/usr/lib64/python3.12/datetime.py'>",
  "math": "<module 'math' from '/usr/lib64/python3.12/lib-dynload/math.cpython-312-x86_64-linux-gnu.so'>",
  "json": "<module 'json' from '/usr/lib64/python3.12/json/__init__.py'>"
} [virtualenv/run/session.py:53]
py: 125 I add seed packages via FromAppData(download=False, pip=bundle, via=copy, app_data_dir=/home/vlotorev/.local/share/virtualenv) [virtualenv/run/session.py:57]
py: 125 D got embed update of distribution %s from ('pip', PosixPath('/home/vlotorev/.local/share/virtualenv/wheel/3.12/embed/3/pip.json')) [virtualenv/app_data/via_disk_folder.py:131]
py: 126 D install pip from wheel /home/vlotorev/tmp/tox/venv/lib64/python3.12/site-packages/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:49]
py: 127 D copy directory /home/vlotorev/.local/share/virtualenv/wheel/3.12/image/1/CopyPipInstall/pip-24.2-py3-none-any/pip-24.2.dist-info to /home/vlotorev/tmp/tox/.tox/py/lib/python3.12/site-packages/pip-24.2.dist-info [virtualenv/util/path/_sync.py:40]
py: 128 D copy /home/vlotorev/.local/share/virtualenv/wheel/3.12/image/1/CopyPipInstall/pip-24.2-py3-none-any/pip-24.2.virtualenv to /home/vlotorev/tmp/tox/.tox/py/lib/python3.12/site-packages/pip-24.2.virtualenv [virtualenv/util/path/_sync.py:40]
py: 129 D copy directory /home/vlotorev/.local/share/virtualenv/wheel/3.12/image/1/CopyPipInstall/pip-24.2-py3-none-any/pip to /home/vlotorev/tmp/tox/.tox/py/lib/python3.12/site-packages/pip [virtualenv/util/path/_sync.py:40]
py: 236 D generated console scripts pip3.12 pip pip-3.12 pip3 [virtualenv/seed/embed/via_app_data/pip_install/base.py:43]
py: 236 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:63]
py: 238 D write /home/vlotorev/tmp/tox/.tox/py/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:33]
py: 238 D       home = /usr/bin [virtualenv/create/pyenv_cfg.py:38]
py: 239 D       implementation = CPython [virtualenv/create/pyenv_cfg.py:38]
py: 239 D       version_info = 3.12.1.final.0 [virtualenv/create/pyenv_cfg.py:38]
py: 239 D       virtualenv = 20.26.5 [virtualenv/create/pyenv_cfg.py:38]
py: 239 D       include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:38]
py: 239 D       base-prefix = /usr [virtualenv/create/pyenv_cfg.py:38]
py: 239 D       base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:38]
py: 239 D       base-executable = /usr/bin/python3.12 [virtualenv/create/pyenv_cfg.py:38]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant