tox icon indicating copy to clipboard operation
tox copied to clipboard

[BUG] Tox incorrectly assumes that `deps` entries containing `~` in the middle are paths

Open webknjaz opened this issue 11 months ago • 0 comments

Issue

$sbj. I've found this while trying to list a dependency with a compatibility operator in the requirement specifier. ~= triggers the bug, >= works. Tox prepends ./ to the requirement, I haven't attempted debugging further.

Environment

I checked this back to 4.0, and it's a problem on every version. I haven't checked if tox v3 had this bug.

Output of running tox

$ tox r -e pre-commit -- pylint -v --all-files
pre-commit: install_deps> python -I -m pip install './pre-commit ~= 4'
ERROR: Invalid requirement: './pre-commit ~= 4': Expected package name at the start of dependency specifier
    ./pre-commit ~= 4
    ^
Hint: It looks like a path. File './pre-commit ~= 4' does not exist.
pre-commit: exit 1 (0.24 seconds) ~/src/github/prj/path> python -I -m pip install './pre-commit ~= 4' pid=128886
  pre-commit: FAIL code 1 (0.26 seconds)
  evaluation failed :( (0.30 seconds)

Minimal example

[testenv:pre-commit]
...
deps =
  pre-commit ~= 4
...

webknjaz avatar Nov 18 '24 14:11 webknjaz