#91 Set Version: %{__default_python3_version} to remove one place to bump, + one minor cleanup
Merged 3 years ago by churchyard. Opened 3 years ago by churchyard.
rpms/ churchyard/python-rpm-macros load_version  into  rawhide

file modified
+10 -5
@@ -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 @@ 

  %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

file modified
+2 -2
@@ -3,8 +3,8 @@ 

  -- Determine alternate names provided from the given name.

  -- Used in pythonname provides generator, python_provide and py_provides.

  -- There are 2 rules:

- --  python3-foo  -> python-foo, python3X-foo

- --  python3X-foo -> python-foo, python3-foo

+ --  python3-foo  -> python-foo, python3.X-foo

+ --  python3.X-foo -> python-foo, python3-foo

  -- There is no python-foo -> rule, python-foo packages are version agnostic.

  -- Returns a table/array with strings. Empty when no rule matched.

  local function python_altnames(name)

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.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

rebased onto b58603f4083be6fc50182329338939b90f69764c

3 years ago

Build succeeded.

There is a very limited amount of people who will ever touch this package so I think that have it in a kinda cryptic form with a reduced possibility for future mistakes is fine. :thumbsup:

rebased onto 8a1e9e0

3 years ago

Build succeeded.

Pull-Request has been merged by churchyard

3 years ago
Metadata