"--force-dep" fails to parse dependencies from requirements file
gnillev opened this issue · comments
I don't know if it is categorized as a bug, since using "-r" in deps is experimental, but:
When using a requirements file, and trying to overwrite/force a specific dependency version via command line --force-dep, tox fails to recognize the dependencies in the requirements file, and hence does not overwrite them, leading to the force-dep to be ignored.
Example tox.ini, where requirements.txt contains pip.
[tox]
envlist = file, dep
skipsdist = True
[testenv]
recreate = True
[testenv:file]
deps = -rrequirements.txt
[testenv:dep]
deps = pip
Now running for instance "tox --force-dep pip==8.1.0" from the tox.ini directory, will for "dep" install pip==8.1.0, but for "file" install the latest pip.
The reason seems to be that tox.config.DepOption._replace_forced_dep does not parse the requirements file, and hence doesn't recognize the pip dependency contained in requirements.txt, so it does not realize that there is a dependency to replace.
To be fair the dep here is passed forward to pip. As such is a blank box for us and can cause all kind of problems trying to unwrap it. I would say this is won't fix until pip has a way to force deps for requirement files.