Bug 2210427

Summary: python-rapidfuzz packages contain pre-generated Cython files
Product: [Fedora] Fedora Reporter: Troy Curtis <troy>
Component: python-rapidfuzzAssignee: Tomáš Hrnčiar <thrnciar>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: python-packagers-sig, thrnciar, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-02 12:24:02 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:
Attachments:
Description Flags
Patch to allow rapidfuzz-2.13.7 to build against Cython 0.29 none

Description Troy Curtis 2023-05-27 13:35:37 UTC
The python-rapidfuzz package contains pre-generated Cython files [1]. 

❯ find -name "*.cxx" -print -exec head -n 1 '{}' \;
./src/rapidfuzz/distance/_initialize_cpp.cxx
/* Generated by Cython 3.0.0a11 */
./src/rapidfuzz/distance/metrics_cpp.cxx
/* Generated by Cython 3.0.0a11 */
./src/rapidfuzz/fuzz_cpp.cxx
/* Generated by Cython 3.0.0a11 */
./src/rapidfuzz/process_cpp_impl.cxx
/* Generated by Cython 3.0.0a11 */
./src/rapidfuzz/utils_cpp.cxx
/* Generated by Cython 3.0.0a11 */

I only know this because I went through getting this setup for packaging it last December [2], but didn't get reviews and I didn't get around to pleading on devel to swap. I'm glad it is packaged now so I can proceed with my python-Levenshtien upgrade!

The unfortunate thing is the Cython generation requires Cython >3.0.0, which isn't packaged for Fedora yet. I did manage to patch python-rapidfuzz to successfully build and run on 0.29 version packaged in Fedora, I'll attach the patch to the ticket. It is against python-rapidfuzz 2.13.7, so should work fine with the current packaged version, but I haven't looked at the latest releases from upstream yet.


1: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_using_cython
2: https://bugzilla.redhat.com/show_bug.cgi?id=2156257



Reproducible: Always

Steps to Reproduce:
1. Download and extract the sources then run:

find -name "*.cxx" -print -exec head -n 1 '{}' \;
Actual Results:  
Found pre-generated files

Expected Results:  
No pre-generated files

Comment 1 Troy Curtis 2023-05-27 13:38:11 UTC
Created attachment 1967280 [details]
Patch to allow rapidfuzz-2.13.7 to build against Cython 0.29

This is the patch to get python-rapidfuzz-2.13.7 to build against Cython 0.29.

Comment 2 Tomáš Hrnčiar 2023-06-01 07:11:33 UTC
Hello Troy, 

thank you for opening the bugzilla and proposing the patch. I've opened PR[0] to incorporate your changes into the package. Would you like to help with co-maintaining the package?

[0] https://src.fedoraproject.org/rpms/python-rapidfuzz/pull-request/1

Comment 3 Troy Curtis 2023-06-03 03:14:57 UTC
Sure, I'd be happy to help out. My FAS is troycurtisjr

Comment 4 Tomáš Hrnčiar 2023-06-05 09:19:28 UTC
Thank you, you have commit access now.

Comment 5 Tomas Orsava 2023-08-02 12:24:02 UTC
PR merged, closing.