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

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

Open
webknjaz opened this issue Nov 18, 2024 · 0 comments

Comments

@webknjaz
Copy link
Contributor

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
...
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