Skip to content

print-deps-only: Document we don't handle recursive deps (from files, e.g. -rrequirements.txt) #22

Open
@hroncok

Description

@hroncok

Fedora report: https://bugzilla.redhat.com/show_bug.cgi?id=1808601

tox docs: https://tox.readthedocs.io/en/latest/example/basic.html#depending-on-requirements-txt-or-defining-constraints

When the dependencies are defined as:

[testenv]
deps = -rrequirements.txt

We need to read the files (recursively) and output their content.

The code that handles this now is

@tox.hookimpl
def tox_runtest(venv, redirect):
"""If --print-deps-only, prints deps instead of running tests"""
config = venv.envconfig.config
unsupported_raise(config, venv)
if config.option.print_deps_path is not None:
with open(config.option.print_deps_path, "a", encoding="utf-8") as f:
print(*venv.get_resolved_dependencies(), sep="\n", file=f)
return True
if config.option.print_deps_only:
print(*venv.get_resolved_dependencies(), sep="\n")
return True

The *venv.get_resolved_dependencies() call needs to be replaced with a custom function call. That function needs to call venv.get_resolved_dependencies() and handle "packages" that start with -r/-c specially.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions