On 25. 04. 26 2:46, Charalampos Stratakis via python-devel wrote:
Hello folks,

Tired of figuring out the right sed or patch to modify dependency constraints in your Python packages? Or having your carefully crafted regex break because upstream reformatted their metadata? %pyproject_patch_dependency is here to help.

A new macro has been merged into pyproject-rpm-macros and is available in Rawhide, F44 and F43 as a provisional feature. It provides a uniform way to override upstream dependency constraints in %prep, regardless of the build backend. It affects both BuildRequires and runtime Requires.

Example usage:

%prep
%autosetup -p1
%pyproject_patch_dependency cython:drop_upper
%pyproject_patch_dependency numpy:set_upper:3.0
%pyproject_patch_dependency legacy-dep:ignore

It also handles circular/sibling dependencies in multi-wheel specs via the br_only suffix. A sibling package can be ignored in BuildRequires (since it's not yet installed during build) while keeping it as a runtime Requires:

%pyproject_patch_dependency sibling-package:ignore:br_only


Consider this dependency:

  Requires-Dist: rich>=13; extra == "rich"

What is `%pyproject_patch_dependency rich:ignore` supposed to do?

It currently drops that entire line. Is that desired? Is it expected?

--
Miro Hrončok
--
Phone: +420777974800

--
_______________________________________________
python-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://forge.fedoraproject.org/infra/tickets/issues/new

Reply via email to