Skip to content

"--force-dep" fails to parse dependencies from requirements file #534

@gnillev

Description

@gnillev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions