classification
Title: distutils produces invalid RPM packages of prerelease python packages
Type: Stage: resolved
Components: Distutils Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: tarek Nosy List: Rudd-O, eric.araujo, tarek
Priority: normal Keywords: patch

Created on 2009-03-11 04:15 by Rudd-O, last changed 2020-10-22 19:40 by eric.araujo. This issue is now closed.

Files
File name Uploaded Description Edit
distutils-bdist_rpm-prereleaseversion.patch Rudd-O, 2009-03-11 04:15 distutils patch
python-2.4-distutils-bdist-rpm.patch (prerequisite for the patch I wrote which is the prereleaseversion.patch) Rudd-O, 2009-03-11 04:24
python-2.4-distutils-bdist_rpm-svnversions.patch Rudd-O, 2009-03-11 07:53 svnversions use case for rpm building
python-2.4-distutils-bdist_rpm-rpmversion-lexicalorder.patch Rudd-O, 2009-03-13 05:51 replaces others, handles improvement of corner cases, provides packager with the ability to turn it off
python-2.4-distutils-bdist_rpm-autodeps.patch Rudd-O, 2009-03-13 08:34 applies on top of the last one (lexicographical order), introduces automatic dependency detection based on egg metadata if available
python-2.4-distutils-bdist_rpm-rpmversion-lexicalorder.patch Rudd-O, 2009-03-13 11:33 fixed lexicographical order patch
Messages (12)
msg83454 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-11 04:15
Description of problem:

Building pre-release python distutils packages with python setup.py
bdist_rpm
works, but the version number is "RPM-higher" than the official release
package
that is released later.

This constitutes a problem because many of the components in major
Python apps
like Zope -- distributed as cheese shop eggs and downloadable via pip or
buildout -- are pre-release packages which, when turned into RPMs, contain
RPM-invalid version numbers.  The RPMs build, but the pre-release
packages are
considered "newer" by yum, so you can imagine the havoc that breaks.

How reproducible:

always


Steps to Reproduce:
1. python setup.py bdist_rpm
2. inspect version / release number of resulting RPMs, find out it's wrong
3. do not profit!

Actual results:

distutils package version: 1.4a
rpm package version: 1.4a


Expected results:

http://fedoraproject.org/wiki/Packaging/NamingGuidelines#Non-Numeric_Version_in_Release

Additional info:

patch attached.  works against python 2.4, may apply fine to python 2.5
or 2.6
too since distutils hasn't undergone that big of a rewrite.  

Ojo: the patch has been tested with distutils AND setuptools.
msg83455 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-11 04:23
Heads up: The fix requires a patch (distributed with the python 2.4.x
RPM in CentOS) to be applied first.  I am attaching said patch so you
can apply the fix.
msg83457 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-11 07:53
the newest svnversions patch is to handle the case of people who want to
build svn checkouts (usually versionnumbered by dev or dev-rXXXYYZZ). 
it overrides the release to be zero so they never upgrade alpha, beta
packages.
msg83509 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-13 05:51
A better patch
msg83511 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-13 08:34
This patch autodetects dependencies based on the earlier patch and egg
metadata, if setuptools is importable.
msg83514 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-13 11:33
brown paper bug in the last lexic patch
msg83579 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-14 11:01
FYI:

http://rudd-o.com/new-projects/python-improvements
msg83708 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-17 23:02
I am considering some changes in the auto-dependency part of the patch.
 Keep tuned.
msg83804 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-03-19 09:04
Please write your patches against the trunk. I'll start to look at them
after Pycon. Regards
msg83850 - (view) Author: Rudd-O (Rudd-O) Date: 2009-03-20 02:09
about python trunk...

gimme some time to port them incrementally to all popular stable pythons
first, then to trunk.  will be glad to do this.

Now, by trunk, do you mean python 3.x?
msg131587 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-21 00:44
With the new Mercurial repositories and adapted workflow, patches should apply to a clone of the 3.1 branch.

If you could also remove outdated or superseded patches from this issue (or give their names if you can’t remove them), it would help reviewing.  Thanks in advance.
msg379328 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2020-10-22 19:40
Given the age of this, the status of distutils and the existence of py2rpm, I am closing it.
History
Date User Action Args
2020-10-22 19:40:41eric.araujosetstatus: open -> closed
resolution: wont fix
messages: + msg379328

stage: resolved
2011-03-21 00:44:48eric.araujosetnosy: + eric.araujo

messages: + msg131587
versions: + Python 3.2, Python 3.3
2009-03-20 02:09:47Rudd-Osetmessages: + msg83850
2009-03-19 09:04:42tareksetmessages: + msg83804
versions: + Python 3.1, Python 2.7, - Python 2.4
2009-03-17 23:02:00Rudd-Osetmessages: + msg83708
2009-03-14 11:01:06Rudd-Osetmessages: + msg83579
2009-03-13 11:33:02Rudd-Osetfiles: + python-2.4-distutils-bdist_rpm-rpmversion-lexicalorder.patch

messages: + msg83514
2009-03-13 08:34:10Rudd-Osetfiles: + python-2.4-distutils-bdist_rpm-autodeps.patch

messages: + msg83511
2009-03-13 05:51:47Rudd-Osetfiles: + python-2.4-distutils-bdist_rpm-rpmversion-lexicalorder.patch

messages: + msg83509
2009-03-11 07:53:41Rudd-Osetfiles: + python-2.4-distutils-bdist_rpm-svnversions.patch

messages: + msg83457
2009-03-11 04:24:41Rudd-Osetfiles: + python-2.4-distutils-bdist-rpm.patch (prerequisite for the patch I wrote which is the prereleaseversion.patch)
2009-03-11 04:23:30Rudd-Osetmessages: + msg83455
2009-03-11 04:15:16Rudd-Ocreate