Bug 1976459

Summary: %pyproject_buildrequires should only fallback to setuptools.build_meta:__legacy__ if setup.py exists
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: pyproject-rpm-macrosAssignee: Tomáš Hrnčiar <thrnciar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mhroncok, pviktori, python-sig
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pyproject-rpm-macros-0-44.fc35 pyproject-rpm-macros-0-46.fc34 pyproject-rpm-macros-0-46.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-02 01:03:18 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 Miro Hrončok 2021-06-26 09:53:16 UTC
See https://github.com/pypa/pip/pull/10031 and https://github.com/pypa/build/issues/259

The common PEP 517 backends (pip, build) interpret this part of PEP 517:

"""
If the pyproject.toml file is absent, or the build-backend key is missing, the source tree is not using this specification, and tools should revert to the legacy behaviour of running setup.py (either directly, or by implicitly invoking the setuptools.build_meta:__legacy__ backend).
"""

As "...should revert to the legacy behavior by running setup.py directly or running setup.py via the setuptools.build_meta:__legacy__ backend."

Since we invoke pip in %pyproject_wheel, we follow the same logic as pip. 

However, %pyproject_buildrequires currently invokes the setuptools.build_meta:__legacy__ backend even if setup.py is missing, which will lead to successful %generate_buildrequires but failed %build (at least with pip >= 21.1.3).

With older pips, it may even lead to installing a Python project called UNKNOWN, see https://github.com/pypa/setuptools/issues/2329


I propose we deal with this by mimicking pip's behavior in %pyproject_buildrequires -- if pyproject.toml is missing or doe snot specify the build backend, we fallback to setuptools.build_meta:__legacy__ *only if* setup.py is present, and error otherwise. For reference, the pip's error message is 'File "setup.py" not found for legacy project {requirement/path/link/...}.'

Comment 2 Fedora Update System 2021-07-19 07:59:04 UTC
FEDORA-2021-fe1bbcfd07 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-fe1bbcfd07

Comment 3 Fedora Update System 2021-07-19 08:01:22 UTC
FEDORA-2021-9874c0ec7b has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-9874c0ec7b

Comment 4 Fedora Update System 2021-07-19 08:01:23 UTC
FEDORA-2021-ffa81019cf has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-ffa81019cf

Comment 5 Fedora Update System 2021-07-19 08:01:35 UTC
FEDORA-2021-fe1bbcfd07 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2021-07-20 01:01:18 UTC
FEDORA-2021-ffa81019cf has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-ffa81019cf`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-ffa81019cf

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2021-07-20 01:47:14 UTC
FEDORA-2021-9874c0ec7b has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-9874c0ec7b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-9874c0ec7b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2021-07-24 01:18:20 UTC
FEDORA-2021-fcf5e2adc6 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-fcf5e2adc6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-fcf5e2adc6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2021-07-24 01:24:58 UTC
FEDORA-2021-3d06d86fe9 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-3d06d86fe9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-3d06d86fe9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2021-08-02 01:03:18 UTC
FEDORA-2021-fcf5e2adc6 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2021-08-02 01:06:12 UTC
FEDORA-2021-3d06d86fe9 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.