Re: [libvirt-python PATCH] build: Adapt to PEP 625 distribution file naming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 10, 2025 at 02:04:39PM +0200, Jiri Denemark via Devel wrote:
> The version of setuptools shipped by Fedora 42 is PEP 625 compliant,
> which requires distribution files to contain a normalized package name.
> Thus the generated tarball is called libvirt_python-$VER.tar.gz rather
> than libvirt-python-$VER.tar.gz created by older setuptools. The source
> directory inside the tarball follows the same naming.
> 
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  .gitlab-ci.yml         |  4 ++--
>  Makefile               |  2 +-
>  libvirt-python.spec.in | 10 ++++++++--
>  3 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index bc4ff48..1267c47 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -34,7 +34,7 @@ stages:
>      - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
>        then
>            unset CFLAGS ;
> -          rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ;
> +          rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt[-_]python*tar.gz ;
>            mv rpmbuild/RPMS/x86_64/ libvirt-python-rpms ;
>        fi
>  
> @@ -51,7 +51,7 @@ stages:
>      - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
>        then
>            unset CFLAGS ;
> -          rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ;
> +          rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt[-_]python*tar.gz ;
>            mv rpmbuild/RPMS/x86_64/ libvirt-python-rpms ;
>        fi
>  
> diff --git a/Makefile b/Makefile
> index 925af40..0b2af28 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -19,4 +19,4 @@ test: all
>  	tox
>  
>  rpm: all
> -	rpmbuild -ta dist/libvirt-python-$(shell tr -d '\n' < VERSION).tar.gz
> +	rpmbuild -ta dist/libvirt[-_]python-$(shell tr -d '\n' < VERSION).tar.gz
> diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
> index e260eaf..dd0c71b 100644
> --- a/libvirt-python.spec.in
> +++ b/libvirt-python.spec.in
> @@ -12,11 +12,17 @@
>      %define supported_platform 0
>  %endif
>  
> +%if 0%{?rhel} || 0%{?fedora} < 42
> +    %define dist_name %{name}
> +%else
> +    %define dist_name libvirt_python
> +%endif

This isn't correct. The dist name depends on the OS on which we create
the release tarball, not the OS we are building for. IOW, while this
may work in CI, it will break in real builds.

> +
>  Summary: The libvirt virtualization API python3 binding
>  Name: libvirt-python
>  Version: @VERSION@
>  Release: 1%{?dist}
> -Source0: https://libvirt.org/sources/python/%{name}-%{version}.tar.gz
> +Source0: https://libvirt.org/sources/python/%{dist_name}-%{version}.tar.gz
>  Url: https://libvirt.org
>  License: LGPL-2.1-or-later
>  BuildRequires: libvirt-devel == %{version}
> @@ -51,7 +57,7 @@ supplied by the libvirt library to use the virtualization capabilities
>  of recent versions of Linux (and other OSes).
>  
>  %prep
> -%setup -q
> +%setup -q -n %{dist_name}-%{version}
>  
>  # Unset execute bit for example scripts; it can introduce spurious
>  # RPM dependencies, like /usr/bin/python3
> -- 
> 2.51.0
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux