Bug 2192581

Summary: RFE: Allow passing config settings to build backends
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: pyproject-rpm-macrosAssignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: gui1ty, maxwell, mhroncok, pviktori, python-packagers-sig
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: pyproject-rpm-macros-1.9.0-1.fc39 pyproject-rpm-macros-1.9.0-1.fc38 pyproject-rpm-macros-1.9.0-1.fc37 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-06-02 08:31:28 UTC Type: ---
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 2023-05-02 11:10:35 UTC
For example, the meson-python build backend supports different config settings as described at https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html#how-to-guides-config-settings

This is useable with build and pip, but not via our macros. It would be nice to support this, so packagers can avoid patching like https://src.fedoraproject.org/rpms/python-scikit-misc/c/3dda47b4b7

Comment 1 Miro Hrončok 2023-05-03 10:50:38 UTC
My raw notes:

pypa/build uses -C
pip uses --config-settings
RPM macros can only take "short" options so we can only mimic the pypa/build API and use -C.



%pyproject_wheel can gain a -C option (with arguments) and pass it to pyproject_wheel.py via %{?**} (as %{?-C} only contains the last -C used and we need to support repeated usage).

pyproject_wheel.py does not currently use argparse but it could be extended to use it. It would then pass all -C options to build_wheel(...), which would pass them as --config-settings to `pip wheel`.


%pyproject_buildrequires would need to gain a -C option as well, for usage with -w. When -C... is used without -w, it should either fail or imply -w.

pyproject_buildrequires.py already takes %{?**}, so the script's argparser could be trivially extended to accept multiple -C arguments and pass them to pyproject_wheel.build_wheel(...).



Overall, I assume this should be quite doable.

Comment 3 Fedora Update System 2023-06-02 08:29:23 UTC
FEDORA-2023-057dff3425 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-057dff3425

Comment 4 Fedora Update System 2023-06-02 08:31:28 UTC
FEDORA-2023-057dff3425 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Fedora Update System 2023-06-02 08:50:42 UTC
FEDORA-2023-2be13415cb has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-2be13415cb

Comment 6 Fedora Update System 2023-06-02 08:50:42 UTC
FEDORA-2023-5a7658328a has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-5a7658328a

Comment 7 Fedora Update System 2023-06-03 02:24:40 UTC
FEDORA-2023-2be13415cb has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-2be13415cb`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-2be13415cb

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

Comment 8 Fedora Update System 2023-06-03 03:18:51 UTC
FEDORA-2023-5a7658328a has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-5a7658328a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-5a7658328a

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

Comment 9 Fedora Update System 2023-06-08 02:02:53 UTC
FEDORA-2023-2be13415cb has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2023-06-18 01:13:56 UTC
FEDORA-2023-5a7658328a has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.