On 27. 09. 24 18:46, Miro Hrončok wrote:
On 24. 09. 24 13:55, Maxwell G wrote:
Later, I'd like to experiment with https://github.com/packit/specfile to write a minimal automatic convertor from the old macros to the new. It won't be perfect and likely won't be able to ditch any manually listed BuildRequires at first, but at least it might allow us to mass update spec files while keeping them buildable.
I think this would be best presented as a tool that maintainers can use to help them convert their packages to the new macros while still requiring manual verification. I am against a bot/script sending a bunch of minimally tested PRs unless we're at a point where deprecation is very imminent and packagers have not taken action—although at that point, package retirement might be the better option.

I drafted a proof of concept:

https://github.com/hroncok/pyprojectize/blob/main/pyprojectize.py

The idea is that we can define individual functions that can update certain aspects of the specfile. Later, we allow users to turn them on/off.

The overall diff is at 
https://github.com/hroncok/pyprojectize/commits/specfiles/

https://github.com/hroncok/pyprojectize/compare/e0193a6a..specfiles

There are some obvious things that will probably blow up:

-%{python3_sitearch}/PyMca5-%{version}-py%{python3_version}.egg-info
+%{python3_sitearch}/PyMca5-%{version}.dist-info

Does this need name-canonization to pymca5?


+AUTOBAHN_USE_NVX=false %pyproject_wheel
+AUTOBAHN_USE_NVX=false %pyproject_install

Setting environment variables like that is not going to work, as the macros expand to several commands.


And there are some outright bugs:

-%{python3_sitelib}/ATpy-*.egg-info
+%{python3_sitelib}/ATpy.dist-info

Here the replacement ate the -* part thinking it is -py3.13.
Not sure how to properly differentiate between:

%{python3_sitelib}/ATpy-*.egg-info
%{python3_sitelib}/ATpy-%{version}-*.egg-info

I guess the name part cannot has dashes in it, so I can work with that.


But generally, it is already pretty good.

--
Miro Hrončok
--
Phone: +420777974800
Fedora Matrix: mhroncok

--
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
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/python-devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to