Bug 489644

Summary: distutils produces invalid RPM packages of prerelease python packages
Product: Red Hat Enterprise Linux 5 Reporter: Rudd-O DragonFear <rudd-o>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED WONTFIX QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-21 04:07:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
fix for distutils
none
prerequisite fix for bdist_rpm
none
updated for svnversions use case
none
replaces others, handles improvement of corner cases, provides packager with the ability to turn it off
none
applies on top of the last one (lexicographical order), introduces automatic dependency detection based on egg metadata if available
none
fixed lexicographical order patch none

Description Rudd-O DragonFear 2009-03-11 03:43:42 UTC
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.

Comment 1 Rudd-O DragonFear 2009-03-11 03:44:08 UTC
Created attachment 334745 [details]
fix for distutils

Comment 2 Rudd-O DragonFear 2009-03-11 04:23:23 UTC
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.

Comment 3 Rudd-O DragonFear 2009-03-11 04:24:12 UTC
Created attachment 334747 [details]
prerequisite fix for bdist_rpm

Comment 4 Rudd-O DragonFear 2009-03-11 07:52:59 UTC
Created attachment 334758 [details]
updated for svnversions use case

Comment 5 Rudd-O DragonFear 2009-03-11 07:53:10 UTC
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.

Comment 6 James Antill 2009-03-11 18:43:25 UTC
You should create a separate BZ for the rpm change, and make this BZ depend on that ... however we don't change python in RHEL lightly, so if you really want this in RHEL I'd highly recommend creating a support request through the normal channels to get the priority bumped on this.

Comment 7 James Antill 2009-03-11 18:45:12 UTC
n/m the first part of the last comment ... I misread what you'd said. You just mean that there are two parts to the patch, to have it functional. Fair enough.

The part about bumping the priority still applies though.

Comment 8 Rudd-O DragonFear 2009-03-11 21:24:11 UTC
ATM I am building my own Python RPMs from 2.4.5 source on RHEL to take care of this issue and to be able to install my own RPMified plone 3.2 packages, cuz otherwise it's "unpossible" as they say in the hood.  I am of course being a good citizen and publishing these RPMs and SRPMs to my workbench / repo -- yum.rudd-o.com.  I have 32 bit and 64 bit versions going on and working just fine.  Feel free to take pointers from my SRPMs.

Comment 9 Rudd-O DragonFear 2009-03-13 05:51:19 UTC
Created attachment 335057 [details]
replaces others, handles improvement of corner cases, provides packager with the ability to turn it off

Comment 10 Rudd-O DragonFear 2009-03-13 08:33:18 UTC
Created attachment 335063 [details]
applies on top of the last one (lexicographical order), introduces automatic dependency detection based on egg metadata if available

Comment 11 Rudd-O DragonFear 2009-03-13 11:33:20 UTC
Created attachment 335072 [details]
fixed lexicographical order patch

brown paper bug in the last lexic patch

Comment 12 Rudd-O DragonFear 2012-02-01 01:34:01 UTC
I guess this never went through...

Distribute has probably the same problem.

Comment 14 RHEL Program Management 2013-03-21 04:07:16 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.