Hello Pythonistas,
pyproject-rpm-macros 1.14.0 landed in Fedora Rawhide and ELN.
It defines a provisional Declarative Buildsystem for RPM 4.20+.
It allows you to write Python specfiles like this:
---------------------------------
Name: python-pello
Version: 1.0.4
Release: %autorelease
Summary: Example Python library
License: MIT-0
URL: https://github.com/fedora-python/Pello
Source: %{url}/archive/v%{version}/Pello-%{version}.tar.gz
BuildSystem: pyproject
BuildOption(install): -l pello
BuildArch: noarch
%description
...
%package -n python3-pello
Summary: %{summary}
%description -n python3-pello
...
%files -n python3-pello -f %{pyproject_files}
%doc README.md
%{_bindir}/pello_greeting
---------------------------------
It will fill-in %prep, %generate_buildrequires, %build, %install, and %check
sections for you. Yet you can configure/extend/override the sections if needed.
Read about all the possibilities at
https://src.fedoraproject.org/rpms/pyproject-rpm-macros/blob/rawhide/f/README.md
in the *Provisional: Declarative Buildsystem (RPM 4.20+)* section.
This is still *provisional* and the API might change in the future.
Beware that RPM in Fedora 39/40 and EPELs does not understand this and RPM <
4.20 will not parse such spec files, so this is inconvenient to use unless you
run Rawhide -- fedpkg prep, rpmbuild -bs, spectool -g, rpmdev-bumpspec won't
work properly...
If you don't use Rawhide, you can build a SRPM like this:
mock -r fedora-rawhide-x86_64 --enablerepo=local --resultdir=./ --buildsrpm
--spec python-pello.spec --source Pello-1.0.4.tar.gz
Or use fedpkg with --srpm-mock.
However, even some infra tools that don't run on Rawhide will likely fail with
a package like this (e.g. Copr or Zuul). Use this at your own risk. Koji builds
SRPMs for Rawhide on Rawhide, so it works there.
Please experiment with this and report back how does it work for you.
Happy packaging.
--
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