#1292 Update example using python3_version_nodots
Opened 11 months ago by salimma. Modified 7 months ago
salimma/packaging-committee fix-python_version_nodots-snippet  into  master

Update example using python3_version_nodots
Michel Alexandre Salim • 11 months ago  
@@ -1815,17 +1815,17 @@ 

  

  [NOTE]

  ====

- As a workaround for compatibility with RPM releases before 4.16 (Fedora 33),

+ As a workaround for compatibility with RPM releases up to 4.16 (EPEL 9),

  `+%{python3_version_nodots}+` can be compared as an integers:

  

  [source,spec]

  ----

- %if %{python3_version_nodots} > 38

+ %if 0%{?python3_version_nodots} > 38

  ...

  %endif

  ----

  

- This will work with Python 3.10 (310 > 39),

+ This will work with Python 3.10 (310 > 38),

  but eventually break with Python 4.0 (40 < 310).

  ====

  

This is not defined until python3-devel is installed, so it has to be
conditionally evaluated just like the previous python3_version
example.

ALso note that the comparison using python3_version does not work on
EPEL 9 as well, and python3_version_nodots is required.

Signed-off-by: Michel Alexandre Salim salimma@fedoraproject.org

@churchyard Not sure if you are still watching these; does this look OK to you?

For context, the EPEL 9 issue came up when working on a PR updating python-flit-core in EPEL 9:

https://src.fedoraproject.org/rpms/python-flit-core/pull-request/8#comment-148127

@churchyard commented pointing to an upstream RPM bug https://src.fedoraproject.org/rpms/python-flit-core/pull-request/8#comment-148677

rebased onto c009436

11 months ago

Hmm.

  • I agree with the 0%{? thing -- +1 to that.
  • I don't understand the 310 > 38 change.

As far as whether or not we say this is needed on EPEL 9: I am not sure. The given example works fine. RPM only breaks when the version thing is used in complex conditionals.

RPM only breaks when the version thing is used in complex conditionals.

This was finally reported to RHEL 9: https://issues.redhat.com/browse/RHEL-15688

Metadata