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

Plugin incompatible with various valid tox deps like --editable #46

Closed
ssbarnea opened this issue Dec 13, 2021 · 5 comments
Closed

Plugin incompatible with various valid tox deps like --editable #46

ssbarnea opened this issue Dec 13, 2021 · 5 comments
Labels
pyproject-rpm-macros The issue is related to Fedora's pyproject-rpm-macros wontfix This will not be worked on

Comments

@ssbarnea
Copy link
Contributor

Any project using pip commands inside deps will break when using tox-current-env because plugin has no idea what to. do with these.

That is even more problematic as that approach of installing dependencies is the only working method for projects that already dropped setup.py and which cannot use the classic tox commands due to known tox bugs.

Traceback (most recent call last):
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 421, in main
    generate_requires(
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 358, in generate_requires
    generate_tox_requirements(toxenv, requirements)
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 311, in generate_tox_requirements
    packages = convert_requirements_txt(deplines)
  File "/usr/lib/rpm/redhat/pyproject_requirements_txt.py", line 63, in convert_requirements_txt
    raise ValueError(f'{filename}: unsupported requirements file option: {line}')
ValueError: <requirements file>: unsupported requirements file option: --editable=.[docker,lint,podman,test,windows]
error: Bad exit status from /var/tmp/rpm-tmp.BW9H1d (%prep)
    line 30: second Description
    Bad exit status from /var/tmp/rpm-tmp.BW9H1d (%prep)
@hroncok
Copy link
Member

hroncok commented Dec 13, 2021

This is a known limitation of the pyproject-rpm-macros. Maybe it needs to be documented. This plugin simply outputs the stuff it gets -- if you pass it e.g. to pip, it should work.

Similarly, if there are pip install-like commands in the commands section, the %tox macro will fail.

For the record, the referenced tox bug here is tox-dev/tox#2197

I don't have a good solution to this. In RPM environment, we cannot install editable installs.

@hroncok
Copy link
Member

hroncok commented Dec 13, 2021

With my Fedora packager hat on, I might only suggest trying to split the environments -- use one for testing, one for testing+coverage. In Fedora Python packages, running coverage checks is discouraged: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters

@hroncok hroncok added the pyproject-rpm-macros The issue is related to Fedora's pyproject-rpm-macros label Dec 13, 2021
@ssbarnea
Copy link
Contributor Author

If project has a requirements.txt file it should be enough for retrieving deps while ignorimg deps from tox.ini. Same for test-requirements.txt

@webknjaz Have a look at this and current PR on molecule. Maybe you can find a workaround?

@webknjaz
Copy link

I agree with Miro — a separate toxenv would be helpful for this.

@hroncok
Copy link
Member

hroncok commented Dec 13, 2021

If project has a requirements.txt file it should be enough for retrieving deps while ignorimg deps from tox.ini. Same for test-requirements.txt

That is possible with %pyproject_buildrequires test-requirements.txt -r.

@hroncok hroncok added the wontfix This will not be worked on label Dec 8, 2022
@hroncok hroncok closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pyproject-rpm-macros The issue is related to Fedora's pyproject-rpm-macros wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants