-
Notifications
You must be signed in to change notification settings - Fork 364
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
Reimplement pythondeps.sh as parametric macro generators #1153
Conversation
I have not yet tested this at all. |
Cool! You'll need to remove pythondeps.sh from scripts/Makefile.am though, that's what the CI is failing on. Also please avoid mixing whitespace changes with actual code changes, especially with %__python_path it's impossible to see offhand whether the actual line changes here or not. |
pythondeps.sh was written in shell and unlike the Python dist generators, it uses no Python, it plainly determines the provide / requires from the path. As the script was run for every Python file, we were potentially doing hundreds of shelling outs to execute a script that calls grep and sed. In Lua, this should be more efficient. Fixes rpm-software-management#1152
Done. Should I convert the indentation to tabs as well, commit another whitespace only tab-removal, or leave as is? |
Some testing:
|
Testing has shown this seems to work for the cases where it is supposed to work. |
Up to you. In an attempt to get some timings for this thing:
The shell version ran for 2m 13s, this version in 0m 18s. Of that 18s, the part of actual dependency generation is half at most. Nice job! 👍 |
Thanks. Do you want to test this in rawhide before we merge this, or merge and fix later if it appears broken somehow? |
I think we can just merge and deal with possible fallout when it hits rawhide, that shouldn't be too far from now. Just letting this sit here for a day or two to give other Python folks a chance to comment. |
In Fedora, we ship this from a different package. So it is not tight on when rpm will be updated but on when python-rpm-generators will. |
Oh, right. Totally forgot about that. I certainly wont object if you want to give it a spin in rawhide before we hit the merge button here, but certainly not required either. |
Is there a way to do something like:
Or do I have to do:
|
Unfortunately there's no meaningful way to track build-side rpm capabilities (just an RFE ticket at #717), so you'll just need to use a versioned dependency on rpm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I acked this on the Fedora side, so here's the same ack on the upstream side. 😄
Okay, no news is good news and nothing heard from Fedora in the 10 days this has been enabled there, lets just merge. |
Oh and while I did compliment on the job, I didn't thank for it. So here goes: thanks! 😁 |
Thanks for being helpful. |
- sync with Fedora - only match direct Python sitedir, no /opt/.../lib/python3.7 stuff - prep for multiple digits Python major releases (e.g. 12.1) - use the value of %_prefix See also: https://src.fedoraproject.org/rpms/python-rpm-generators/c/8eef42cbaa6ff0e5c006959fc06ec115ed5ca37b https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/UFKUM5UKCTNGIT3KJVYEI5VXPI23QMBN/ rpm-software-management#1153 (comment)
pythondeps.sh was written in shell and unlike the Python dist generators, it uses no Python, it plainly determines the provide / requires from the path. As the script was run for every Python file, we were potentially doing hundreds of shelling outs to execute a script that calls grep and sed. In Lua, this is much more efficient. Some timings: rpm-software-management/rpm#1153 (comment) Parametric macro generators require RPM 4.16+: https://fedoraproject.org/wiki/Changes/RPM-4.16 Fixes rpm-software-management/rpm#1152 Upstream PR: rpm-software-management/rpm#1153 Since this is intended for Fedora 33+ only, clean some old cruft.
- sync with Fedora - only match direct Python sitedir, no /opt/.../lib/python3.7 stuff - prep for multiple digits Python major releases (e.g. 12.1) - use the value of %_prefix See also: https://src.fedoraproject.org/rpms/python-rpm-generators/c/8eef42cbaa6ff0e5c006959fc06ec115ed5ca37b https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/UFKUM5UKCTNGIT3KJVYEI5VXPI23QMBN/ #1153 (comment)
- sync with Fedora - only match direct Python sitedir, no /opt/.../lib/python3.7 stuff - prep for multiple digits Python major releases (e.g. 12.1) - use the value of %_prefix See also: https://src.fedoraproject.org/rpms/python-rpm-generators/c/8eef42cbaa6ff0e5c006959fc06ec115ed5ca37b https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/UFKUM5UKCTNGIT3KJVYEI5VXPI23QMBN/ rpm-software-management/rpm#1153 (comment)
pythondeps.sh was written in shell and unlike the Python dist generators,
it uses no Python, it plainly determines the provide / requires from the path.
As the script was run for every Python file, we were potentially doing hundreds
of shelling outs to execute a script that calls grep and sed.
In Lua, this should be more efficient.
Fixes #1152