#3 Added Patch 1: Canonicalize Python versions and properly handle != spec
Merged 2 months ago by churchyard. Opened 2 months ago by torsava.
rpms/ torsava/python-rpm-generators master  into  master

file modified
+4 -1

@@ -4,7 +4,7 @@ 

  

  Name:           python-rpm-generators

  Summary:        Dependency generators for Python RPMs

- Version:        8

+ Version:        9

  Release:        1%{?dist}

  

  # Originally all those files were part of RPM, so license is kept here

@@ -49,6 +49,9 @@ 

  %{_rpmconfigdir}/pythondistdeps.py

  

  %changelog

+ * Mon Jun 24 2019 Tomas Orsava <torsava@redhat.com> - 9-1

+ - Canonicalize Python versions and properly handle != spec

+ 

  * Wed Apr 17 2019 Miro Hrončok <mhroncok@redhat.com> - 8-1

  - console_scripts entry points to require setuptools

    https://github.com/rpm-software-management/rpm/pull/666

file modified
+14 -7

@@ -151,7 +151,10 @@ 

                  if legacy_name not in py_deps:

                      py_deps[legacy_name] = []

              if dist.version:

-                 spec = ('==', dist.version)

+                 version = dist.version

+                 while version.endswith('.0'):

+                     version = version[:-2]

+                 spec = ('==', version)

                  if spec not in py_deps[name]:

                      if not legacy:

                          py_deps[name].append(spec)

@@ -195,11 +198,12 @@ 

                      else:

                          name = 'python{}dist({})'.format(dist.py_version, dep.key)

                  for spec in dep.specs:

-                     if spec[0] != '!=':

-                         if name not in py_deps:

-                             py_deps[name] = []

-                         if spec not in py_deps[name]:

-                             py_deps[name].append(spec)

+                     while spec[1].endswith('.0'):

+                         spec = (spec[0], spec[1][:-2])

+                     if name not in py_deps:

+                         py_deps[name] = []

+                     if spec not in py_deps[name]:

+                         py_deps[name].append(spec)

                  if not dep.specs:

                      py_deps[name] = []

          # Unused, for automatic sub-package generation based on 'extras' from egg/dist metadata

@@ -245,7 +249,10 @@ 

      if py_deps[name]:

          # Print out versioned provides, requires, recommends, conflicts

          for spec in py_deps[name]:

-             print('{} {} {}'.format(name, spec[0], spec[1]))

+             if spec[0] == '!=':

+                 print('({n} < {v} or {n} >= {v}.0)'.format(n=name, v=spec[1]))

+             else:

+                 print('{} {} {}'.format(name, spec[0], spec[1]))

      else:

          # Print out unversioned provides, requires, recommends, conflicts

          print(name)

It'd be better to just apply the patch to this repo instead and submit the PR that way. This is weird and unnecessary.

Oh I see. I originally followed the upstream RPM release versions with this package, but now I see we're on an increment-version-each-time type of versioning, so this makes sense.

rebased onto e1a6f07

2 months ago

please remove "Added Patch 1"

rebased onto ff085a0

2 months ago

Thanks. And sorry for the confusion with the versions and patches and such.

Let's ship this for rawhide and see what breaks :smiling_imp:

Pull-Request has been merged by churchyard

2 months ago