From 8a1e9e09530d2e13a72c9f9808d64985054e0463 Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Feb 24 2021 12:05:56 +0000 Subject: Set Version: %{__default_python3_version} to remove one place to bump Since Fedora 33, the package version always == %{__default_python3_version}. When we update Python to 3.X+1, we update the version and the macro. When the macro is not updated confusing things happen. See for example https://bugzilla.redhat.com/show_bug.cgi?id=1931421#c4 We could assert the versions match in %check instead, but this way a temporary pull request for a new Python version, such as https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/50 https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/84 can be kept rebased via the git forge UI. Note that the value of %{__default_python3_version} is loaded from sources in dist git, otherwise it would be defined by the previous build of this package. As a result, the spec file is no longer parsable on it's own, but IMHO that's OK. --- diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 27d568e..cd2437b 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,11 +1,6 @@ Name: python-rpm-macros -Version: 3.9 -Release: 35%{?dist} Summary: The common Python RPM macros -# macros and lua: MIT, compileall2.py: PSFv2 -License: MIT and Python - # Macros: Source101: macros.python Source102: macros.python-srpm @@ -19,6 +14,16 @@ Source201: python.lua %global compileall2_version 0.7.1 Source301: https://github.com/fedora-python/compileall2/raw/v%{compileall2_version}/compileall2.py +# macros and lua: MIT, compileall2.py: PSFv2 +License: MIT and Python + +# The package version MUST be always the same as %%{__default_python3_version}. +# To have only one source of truth, we load the macro and use it. +# The macro is defined in python-srpm-macros. + %{load:%{SOURCE102}} +Version: %{__default_python3_version} +Release: 35%{?dist} + BuildArch: noarch # For %%__default_python3_pkgversion used in %%python_provide