Bug 1808601

Summary: tox dependency generator cannot handle deps read in from a text file
Product: [Fedora] Fedora Reporter: Adam Williamson <awilliam>
Component: pyproject-rpm-macrosAssignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 32CC: j, mhroncok, pkopkan, pviktori, python-sig
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pyproject-rpm-macros-0-13.fc30 pyproject-rpm-macros-0-13.fc31 pyproject-rpm-macros-0-13.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-14 00:25:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Williamson 2020-02-28 22:34:46 UTC
If your tox.ini looks like this:

deps =
    -r{toxinidir}/install.requires
    -r{toxinidir}/tests.requires

then the pyproject tox deps generator won't work:

Handling -r/builddir/build/BUILD/openqa_client-4.0.0.dev0/install.requires from tox --print-deps-only: py38
WARNING: Skipping invalid requirement: -r/builddir/build/BUILD/openqa_client-4.0.0.dev0/install.requires
    Parse error at "'-r/build'": Expected W:(abcd...)
Handling -r/builddir/build/BUILD/openqa_client-4.0.0.dev0/tests.requires from tox --print-deps-only: py38
WARNING: Skipping invalid requirement: -r/builddir/build/BUILD/openqa_client-4.0.0.dev0/tests.requires
    Parse error at "'-r/build'": Expected W:(abcd...)

Comment 1 Miro Hrončok 2020-02-28 22:49:29 UTC
Thanks for the report. Technically, https://github.com/fedora-python/tox-current-env cannot (yet) handle that. It prints out venv.get_resolved_dependencies() from tox. I wonder if what you do works in pure tox by accident or by design - if it is design, maybe get_resolved_dependencies() should open the files instead of passing it as arguments to pip?

Comment 2 Adam Williamson 2020-02-28 23:02:30 UTC
I've seen it used quite widely, and it's in the official docs (though marked as "New in version 1.6.1. (experimental)": https://tox.readthedocs.io/en/latest/example/basic.html#depending-on-requirements-txt-or-defining-constraints

Comment 3 Miro Hrončok 2020-02-28 23:14:01 UTC
Ok, so the docs say "This is actually a side effect that all elements of the dependency list is directly passed to pip."

I've opened https://github.com/fedora-python/tox-current-env/issues/22

Comment 4 Miro Hrončok 2020-03-02 10:32:05 UTC
Given where https://github.com/fedora-python/tox-current-env/issues/22 is going, I'll try to fix this form the macros.

Comment 6 Fedora Update System 2020-03-06 10:58:11 UTC
FEDORA-2020-901bee4b70 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-901bee4b70

Comment 7 Fedora Update System 2020-03-06 10:58:17 UTC
FEDORA-2020-f0b861e528 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-f0b861e528

Comment 8 Fedora Update System 2020-03-06 20:23:33 UTC
pyproject-rpm-macros-0-13.fc32 has been pushed to the Fedora 32 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-901bee4b70

Comment 9 Fedora Update System 2020-03-06 21:58:59 UTC
pyproject-rpm-macros-0-13.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b82d2975cf

Comment 10 Fedora Update System 2020-03-06 22:07:03 UTC
pyproject-rpm-macros-0-13.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-f0b861e528

Comment 11 Fedora Update System 2020-03-14 00:25:03 UTC
pyproject-rpm-macros-0-13.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2020-03-14 00:37:13 UTC
pyproject-rpm-macros-0-13.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2020-03-16 20:34:46 UTC
pyproject-rpm-macros-0-13.fc32 has been pushed to the Fedora 32 stable repository. If problems still persist, please make note of it in this bug report.