#1 Fix egginfo on Fedora < 33 so the auto-generated Provides has the right version
Merged 2 years ago by dcavalca. Opened 2 years ago by salimma.
rpms/ salimma/python-typeguard f32-epel8-fix  into  master

file modified
+9 -2
@@ -2,7 +2,7 @@ 

  

  Name:           python-%{pypi_name}

  Version:        2.10.0

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Run-time type checker for Python

  License:        MIT

  URL:            https://github.com/agronholm/%{pypi_name}
@@ -38,7 +38,11 @@ 

  

  %prep

  %autosetup -n %{pypi_name}-%{version}

- rm -rf %{pypi_name}.egg-info/*

+ rm -rf %{pypi_name}.egg-info

+ %if 0%{?fedora} < 33 || 0%{?rhel} < 9

+ # older setuptools generates PKG-INFO with version=='0.0.0' unless specified

+ sed -i '/name = typeguard/a version = %{version}' setup.cfg

+ %endif

  

  %build

  %py3_build
@@ -56,6 +60,9 @@ 

  %{python3_sitelib}/%{pypi_name}-*.egg-info/

  

  %changelog

+ * Thu Jan 14 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 2.10.0-2

+ - Fix egginfo on Fedora < 33 so the auto-generated Provides has the right version

+ 

  * Mon Oct 26 2020 Christopher Brown <chris.brown@redhat.com> - 2.10.0-1

  - Update to 2.10.0

  - Remove conditional as python 3.9 now supported

If setup.cfg does not have a declared version, the generated PKG-INFO has version set to 0.0.0. This does not seem to affect newer setuptools in Fedora >= 33 (and the upcoming RHEL >= 9)

$ rpm -qp --provides ~/Downloads/python3-typeguard-2.10.0-1.el8.noarch.rpm
python3-typeguard = 2.10.0-1.el8
python3.6dist(typeguard) = 0.0.0
python3dist(typeguard) = 0.0.0

$ rpm -qp --provides /var/lib/mock/epel-8-x86_64/result/python3-typeguard-2.10.0-2.el8.noarch.rpm
python3-typeguard = 2.10.0-2.el8
python3.6dist(typeguard) = 2.10.0
python3dist(typeguard) = 2.10.0

$ rpm -qp --provides ~/Downloads/python3-typeguard-2.10.0-1.fc32.noarch.rpm
python-typeguard = 2.10.0-1.fc32
python3-typeguard = 2.10.0-1.fc32
python3.8dist(typeguard) = 0
python3dist(typeguard) = 0

$ rpm -qp --provides /var/lib/mock/fedora-32-x86_64/result/python3-typeguard-2.10.0-2.fc32.noarch.rpm
python-typeguard = 2.10.0-2.fc32
python3-typeguard = 2.10.0-2.fc32
python3.8dist(typeguard) = 2.10
python3dist(typeguard) = 2.10

$ rpm -qp --provides ~/Downloads/python3-typeguard-2.10.0-1.fc33.noarch.rpm
python-typeguard = 2.10.0-1.fc33
python3-typeguard = 2.10.0-1.fc33
python3.9-typeguard = 2.10.0-1.fc33
python3.9dist(typeguard) = 2.10
python3dist(typeguard) = 2.10

Signed-off-by: Michel Alexandre Salim michel@michel-slm.name

Pull-Request has been merged by dcavalca

2 years ago