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

Process parameters are messed up for a specific case of path #2809

Open
facundobatista opened this issue Jan 3, 2023 · 1 comment
Open
Labels
bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@facundobatista
Copy link

Issue

We had this in the tox file:

codespell {toxinidir}/. --skip {toxinidir}/.git 

In tox 3.27 it worked fine, but in 4.0 codespell was run without the --skip parameter.

The workaround was to change the first parameter like this (that should be innocuous):

codespell {toxinidir} --skip {toxinidir}/.git 

Environment

Provide at least:

  • OS: Ubuntu 22.04.1 LTS
  • pip list of the host Python where tox is installed:
Package      Version
------------ -------
distlib      0.3.6
filelock     3.8.2
packaging    22.0
pip          22.3.1
platformdirs 2.6.0
pluggy       1.0.0
py           1.11.0
setuptools   59.6.0
six          1.16.0
tomli        2.0.1
tox          3.27.1
virtualenv   20.17.1

Output of running tox

Provide the output of tox -rvv:

$ fades -d tox -x tox -rvv -e lint
lint: 102 W remove tox env folder /tmp/newproy/.tox/lint [tox/tox_env/api.py:311]
lint: 137 I find interpreter for spec PythonSpec(path=/home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/bin/python) [virtualenv/discovery/builtin.py:56]
lint: 137 D discover exe for PythonInfo(spec=CPython3.10.6.final.0-64, exe=/home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/bin/python, platform=linux, version='3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]', encoding_fs_io=utf-8-utf-8) in /usr [virtualenv/discovery/py_info.py:437]
lint: 137 D filesystem is case-sensitive [virtualenv/info.py:24]
lint: 138 D got python info of /usr/bin/python3.10 from /home/facundo/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.json [virtualenv/app_data/via_disk_folder.py:129]
lint: 138 I proposed PythonInfo(spec=CPython3.10.6.final.0-64, system=/usr/bin/python3.10, exe=/home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/bin/python, platform=linux, version='3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]
lint: 138 D accepted PythonInfo(spec=CPython3.10.6.final.0-64, system=/usr/bin/python3.10, exe=/home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/bin/python, platform=linux, version='3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]
lint: 156 I create virtual environment via CPython3Posix(dest=/tmp/newproy/.tox/lint, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48]
lint: 156 D create folder /tmp/newproy/.tox/lint/bin [virtualenv/util/path/_sync.py:9]
lint: 156 D create folder /tmp/newproy/.tox/lint/lib/python3.10/site-packages [virtualenv/util/path/_sync.py:9]
lint: 156 D write /tmp/newproy/.tox/lint/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
lint: 156 D     home = /usr/bin [virtualenv/create/pyenv_cfg.py:34]
lint: 156 D     implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
lint: 156 D     version_info = 3.10.6.final.0 [virtualenv/create/pyenv_cfg.py:34]
lint: 156 D     virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
lint: 156 D     include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
lint: 156 D     base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
lint: 156 D     base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
lint: 156 D     base-executable = /usr/bin/python3.10 [virtualenv/create/pyenv_cfg.py:34]
lint: 156 D symlink /usr/bin/python3.10 to /tmp/newproy/.tox/lint/bin/python [virtualenv/util/path/_sync.py:28]
lint: 157 D create virtualenv import hook file /tmp/newproy/.tox/lint/lib/python3.10/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89]
lint: 157 D create /tmp/newproy/.tox/lint/lib/python3.10/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92]
lint: 157 D ============================== target debug ============================== [virtualenv/run/session.py:50]
lint: 157 D debug via /tmp/newproy/.tox/lint/bin/python /home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/lib/python3.10/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197]
lint: 157 D {
  "sys": {
    "executable": "/tmp/newproy/.tox/lint/bin/python",
    "_base_executable": "/tmp/newproy/.tox/lint/bin/python",
    "prefix": "/tmp/newproy/.tox/lint",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/tmp/newproy/.tox/lint",
    "base_exec_prefix": "/usr",
    "path": [
      "/home/facundo/.bin/pymods",
      "/usr/lib/python310.zip",
      "/usr/lib/python3.10",
      "/usr/lib/python3.10/lib-dynload",
      "/tmp/newproy/.tox/lint/lib/python3.10/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.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]",
  "makefile_filename": "/usr/lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/lib/python3.10/os.py'>",
  "site": "<module 'site' from '/usr/lib/python3.10/site.py'>",
  "datetime": "<module 'datetime' from '/usr/lib/python3.10/datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from '/usr/lib/python3.10/json/__init__.py'>"
} [virtualenv/run/session.py:51]
lint: 206 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/facundo/.local/share/virtualenv) [virtualenv/run/session.py:55]
lint: 210 D got embed update of distribution wheel from /home/facundo/.local/share/virtualenv/wheel/3.10/embed/3/wheel.json [virtualenv/app_data/via_disk_folder.py:129]
lint: 211 D got embed update of distribution pip from /home/facundo/.local/share/virtualenv/wheel/3.10/embed/3/pip.json [virtualenv/app_data/via_disk_folder.py:129]
lint: 211 D got embed update of distribution setuptools from /home/facundo/.local/share/virtualenv/wheel/3.10/embed/3/setuptools.json [virtualenv/app_data/via_disk_folder.py:129]
lint: 215 D install wheel from wheel /home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/wheel-0.38.4-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
lint: 215 D install setuptools from wheel /home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/setuptools-65.6.3-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
lint: 216 D install pip from wheel /home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-22.3.1-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
lint: 217 D copy directory /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/wheel [virtualenv/util/path/_sync.py:36]
lint: 218 D copy /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.virtualenv to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/pip-22.3.1.virtualenv [virtualenv/util/path/_sync.py:36]
lint: 218 D copy directory /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/setuptools [virtualenv/util/path/_sync.py:36]
lint: 219 D copy directory /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.dist-info to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/pip-22.3.1.dist-info [virtualenv/util/path/_sync.py:36]
lint: 222 D copy directory /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/pip [virtualenv/util/path/_sync.py:36]
lint: 225 D copy directory /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.dist-info to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/wheel-0.38.4.dist-info [virtualenv/util/path/_sync.py:36]
lint: 227 D copy /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.virtualenv to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/wheel-0.38.4.virtualenv [virtualenv/util/path/_sync.py:36]
lint: 228 D generated console scripts wheel wheel-3.10 wheel3.10 wheel3 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
lint: 291 D copy directory /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.dist-info to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/setuptools-65.6.3.dist-info [virtualenv/util/path/_sync.py:36]
lint: 294 D copy /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/distutils-precedence.pth to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:36]
lint: 294 D copy directory /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/_distutils_hack to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:36]
lint: 295 D copy directory /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/pkg_resources to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/pkg_resources [virtualenv/util/path/_sync.py:36]
lint: 312 D copy /home/facundo/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.virtualenv to /tmp/newproy/.tox/lint/lib/python3.10/site-packages/setuptools-65.6.3.virtualenv [virtualenv/util/path/_sync.py:36]
lint: 314 D generated console scripts  [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
lint: 339 D generated console scripts pip3.10 pip3 pip-3.10 pip [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
lint: 340 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:61]
lint: 343 D write /tmp/newproy/.tox/lint/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
lint: 343 D     home = /usr/bin [virtualenv/create/pyenv_cfg.py:34]
lint: 343 D     implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
lint: 343 D     version_info = 3.10.6.final.0 [virtualenv/create/pyenv_cfg.py:34]
lint: 343 D     virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
lint: 343 D     include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
lint: 343 D     base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
lint: 343 D     base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
lint: 343 D     base-executable = /usr/bin/python3.10 [virtualenv/create/pyenv_cfg.py:34]
lint: 346 W install_deps> python -I -m pip install codespell [tox/tox_env/api.py:417]
Collecting codespell
  Using cached codespell-2.2.2-py3-none-any.whl (214 kB)
Installing collected packages: codespell
Successfully installed codespell-2.2.2
lint: 1820 I exit 0 (1.47 seconds) /tmp/newproy> python -I -m pip install codespell pid=2457830 [tox/execute/api.py:275]
lint: 1821 W commands[0]> codespell /tmp/newproy/. --skip /tmp/newproy/.git --skip /tmp/newproy/.tox --skip /tmp/newproy/build --skip /tmp/newproy/lib --skip /tmp/newproy/venv --skip /tmp/newproy/.mypy_cache --skip /tmp/newproy/icon.svg [tox/tox_env/api.py:417]
/tmp/newproy/./.tox/lint/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py:535: fo ==> of, for, to, do, go
/tmp/newproy/./.tox/lint/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py:561: fo ==> of, for, to, do, go
/tmp/newproy/./.tox/lint/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py:572: Fo ==> Of, For, To, Do, Go
(... ton of similar errors ...)
/tmp/newproy/./.tox/fmt/lib/python3.10/site-packages/black/parsing.py:112: te ==> the, be, we, to
/tmp/newproy/./.tox/fmt/lib/python3.10/site-packages/black/lines.py:731: formattings ==> formatting
/tmp/newproy/./.tox/fmt/lib/python3.10/site-packages/black/lines.py:769: formattings ==> formatting
lint: 3955 C exit 65 (2.13 seconds) /tmp/newproy> codespell /tmp/newproy/. --skip /tmp/newproy/.git --skip /tmp/newproy/.tox --skip /tmp/newproy/build --skip /tmp/newproy/lib --skip /tmp/newproy/venv --skip /tmp/newproy/.mypy_cache --skip /tmp/newproy/icon.svg pid=2457878 [tox/execute/api.py:275]
  lint: FAIL code 65 (3.85=setup[1.72]+cmd[2.13] seconds)
  evaluation failed :( (3.89 seconds)

Minimal example

If possible, provide a minimal reproducer for the issue:

[testenv:lint]
description = Check code against coding style standards
deps =
    codespell
commands =
    codespell {toxinidir}/. \
              --skip {toxinidir}/.git \
              --skip {toxinidir}/.tox \
              --skip {toxinidir}/build \
              --skip {toxinidir}/lib \
              --skip {toxinidir}/venv \
              --skip {toxinidir}/.mypy_cache \
              --skip {toxinidir}/icon.svg

When running with old and new tox:

$ fades -d "tox < 4" -x tox --version
3.27.1 imported from /home/facundo/.local/share/fades/0a63e6cf-8a13-47ea-91ff-4d5878543117/lib/python3.10/site-packages/tox/__init__.py

$ fades -d "tox < 4" -x tox -e lint
lint recreate: /tmp/newproy/.tox/lint
lint installdeps: codespell
lint installed: codespell==2.2.2
lint run-test-pre: PYTHONHASHSEED='3379135892'
lint run-test: commands[0] | codespell /tmp/newproy/. --skip /tmp/newproy/.git --skip /tmp/newproy/.tox --skip /tmp/newproy/build --skip /tmp/newproy/lib --skip /tmp/newproy/venv --skip /tmp/newproy/.mypy_cache --skip /tmp/newproy/icon.svg
_____________________________________________________________________________________ summary _____________________________________________________________________________________
  lint: commands succeeded
  congratulations :)

$ fades -d tox -x tox --version
4.0.11 from /home/facundo/.local/share/fades/db02a195-2f4c-4127-af62-2b9faed4ec8a/lib/python3.10/site-packages/tox/__init__.py

$ fades -d tox -x tox -e lint
lint: install_deps> python -I -m pip install codespell
lint: commands[0]> codespell /tmp/newproy/. --skip /tmp/newproy/.git --skip /tmp/newproy/.tox --skip /tmp/newproy/build --skip /tmp/newproy/lib --skip /tmp/newproy/venv --skip /tmp/newproy/.mypy_cache --skip /tmp/newproy/icon.svg
/tmp/newproy/./.tox/lint/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py:535: fo ==> of, for, to, do, go
/tmp/newproy/./.tox/lint/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py:561: fo ==> of, for, to, do, go
/tmp/newproy/./.tox/lint/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py:572: Fo ==> Of, For, To, Do, Go
(... ton of similar errors ...)
/tmp/newproy/./.tox/fmt/lib/python3.10/site-packages/black/parsing.py:112: te ==> the, be, we, to
/tmp/newproy/./.tox/fmt/lib/python3.10/site-packages/black/lines.py:731: formattings ==> formatting
/tmp/newproy/./.tox/fmt/lib/python3.10/site-packages/black/lines.py:769: formattings ==> formatting
lint: exit 65 (2.15 seconds) /tmp/newproy> codespell /tmp/newproy/. --skip /tmp/newproy/.git --skip /tmp/newproy/.tox --skip /tmp/newproy/build --skip /tmp/newproy/lib --skip /tmp/newproy/venv --skip /tmp/newproy/.mypy_cache --skip /tmp/newproy/icon.svg pid=2456922
  lint: FAIL code 65 (3.25=setup[1.10]+cmd[2.15] seconds)
  evaluation failed :( (3.28 seconds)
@gaborbernat gaborbernat added bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. labels Jan 3, 2023
@gaborbernat
Copy link
Member

PR to fix this would be welcome.

@gaborbernat gaborbernat added this to the P-1 milestone Jan 3, 2023
@gaborbernat gaborbernat removed this from the P-1 milestone Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

No branches or pull requests

2 participants