This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 395651 - Review Request: python-enum - Robust enumerated type support in Python
Review Request: python-enum - Robust enumerated type support in Python
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Lauridsen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-22 08:32 EST by Matěj Cepl
Modified: 2014-07-18 10:54 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-23 12:20:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
tla: fedora‑review+
limburgher: fedora‑cvs+


Attachments (Terms of Use)

  None (edit)
Description Matěj Cepl 2007-11-22 08:32:45 EST
Spec URL: http://mcepl.fedorapeople.org/rpms/python-enum.spec
SRPM URL: http://koji.fedoraproject.org/koji/getfile?taskID=254391&name=python-enum-0.4.3-1.fc9.src.rpm
Description:
This package provides a module for robust enumerations in Python.

An enumeration object is created with a sequence of string arguments
to the Enum() constructor::

>>> from enum import Enum
>>> Colours = Enum('red', 'blue', 'green')
>>> Weekdays = Enum('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun')

The return value is an immutable sequence object with a value for each
of the string arguments. Each value is also available as an attribute
named from the corresponding string argument::

>>> pizza_night = Weekdays[4]
>>> shirt_colour = Colours.green

The values are constants that can be compared only with values from
the same enumeration; comparison with other values will invoke
Python's fallback comparisons::

>>> pizza_night == Weekdays.fri
True
>>> shirt_colour > Colours.red
True
>>> shirt_colour == "green"
False

Each value from an enumeration exports its sequence index
as an integer, and can be coerced to a simple string matching the
original arguments used to create the enumeration::

>>> str(pizza_night)
'fri'
>>> shirt_colour.index
2
Comment 1 Matěj Cepl 2007-11-22 08:34:23 EST
Scratch built in koji
http://koji.fedoraproject.org/koji/taskinfo?taskID=254391
(src.rpm is also available at http://mcepl.fedorapeople.org/rpms)
Comment 2 Tim Lauridsen 2007-11-22 08:55:22 EST
I will review this tomorrow, but i have some prelimynary comments.

Just write the what the package does in the decription in the spec, not how it
does it. That info should be placed in some DOCS.

for F8 you have to use
BuildRequires: python-setuptools-devel

Something like this will work.

%if 0%{?fedora} >= 8
BuildRequires: python-setuptools-devel
%else
BuildRequires: python-setuptools
%endif
Comment 4 Tim Lauridsen 2007-11-23 00:06:44 EST
? rpmlint must be silent.

$rpmlint /data/dnl/python-enum-0.4.3-2.fc9.src.rpm 

$ rpmlint python-enum-0.4.3-2.fc8.noarch.rpm 
python-enum.noarch: W: incoherent-version-in-changelog 0.4.3-2.fc9 0.4.3-2.fc8

caused by the 0.4.3-2.fc9 in the Changelog entries, just use 0.4.3-2.

* source match upstream source 

[tim@localhost ~]$ md5sum /data/dnl/enum-0.4.3.tar.gz 
f0e2bd1a0a581897ea3ed245a1db6c8e  /data/dnl/enum-0.4.3.tar.gz
[tim@localhost ~]$ md5sum rpmbuild/SOURCES/enum-0.4.3.tar.gz 
f0e2bd1a0a581897ea3ed245a1db6c8e  rpmbuild/SOURCES/enum-0.4.3.tar.gz
[tim@localhost ~]$ 



Comment 5 Tim Lauridsen 2007-11-23 00:28:24 EST
MUST:
* package is named appropriately
* it is legal for Fedora to distribute this
? license field matches the actual license.
  Package is dual licensed GPLv2+ or Python, just use GPLv2+ in the License field.
* license is open source-compatible.
* specfile name matches %{name}
* summary and description fine
* correct buildroot
* %{?dist} is used
* license text included in package and marked with %doc
* package meets FHS (http://www.pathname.com/fhs/)
? changelog format fine 
See earlier comment.
* Packager tag not used
* Vendor tag not used
* Distribution tag not used
* License used and not Copyright 
* Summary tag does not end in a period
* specfile is legible
* package successfully compiles and builds on at least x86
* make sure lines are <= 80 characters
* specfile written in American English
* no -doc sub-package necessary
* no libraries
* no rpath
* not a GUI app
* no -devel sub-package necessary
* macros used appropriately and consistently
* no %makeinstall
* install section must begin with rm -rf $RPM_BUILD_ROOT or %{buildroot}
* no locale data
* split Requires(pre,post) into two separate lines
* package not relocatable
* package contains code
* package owns all directories and files
* no %files duplicates
* %defattrs present ( %defattr(-, root, root, -))
* %clean present
* %doc files do not affect runtime
Comment 6 Tim Lauridsen 2007-11-23 01:40:03 EST
* verify the final provides and requires of the binary RPMs

   $ rpm -q -R -p rpmbuild/RPMS/noarch/python-enum-0.4.3-2.fc8.noarch.rpm 
     python(abi) = 2.5
     rpmlib(CompressedFileNames) <= 3.0.4-1
     rpmlib(PayloadFilesHavePrefix) <= 4.0-1

   $ rpm -q --provides -p rpmbuild/RPMS/noarch/python-enum-0.4.3-2.fc8.noarch.rpm 
     python-enum = 0.4.3-2.fc8


SHOULD:
* package should include license text in the package and mark it with %doc
* package should build on i386
? package should build in mock
 - I haven't tried, but I don't think it'll be a problem


Fixes the license field and the the changelog entry versions and it is

APPROVED.

Comment 7 Matěj Cepl 2007-11-23 06:33:38 EST
(In reply to comment #5)
> MUST:
> ? license field matches the actual license.
>   Package is dual licensed GPLv2+ or Python, just use GPLv2+ in the License field.

That's incorrect -- I can and I should use what I did.
http://fedoraproject.org/wiki/PackagingDrafts/LicenseTag#head-35bf3683af78c7c47752f336efbee5029d35921a
'the spec must reflect this by using "or" as a separator.'

> ? changelog format fine 
> See earlier comment.

OK, fixed.

> ? package should build in mock
> - I haven't tried, but I don't think it'll be a problem

It was built in koji, which is even better than mock (because it is
multiplatform build -- not relevant in this case, true).

New and upgraded package is available at
http://koji.fedoraproject.org/koji/getfile?taskID=255432&name=python-enum-0.4.3-3.fc9.src.rpm
(build page in koji is http://koji.fedoraproject.org/koji/taskinfo?taskID=255432)
Comment 8 Matěj Cepl 2007-11-23 06:49:58 EST
New Package CVS Request
=======================
Package Name: python-enum
Short Description: Robust enumerated type support in Python
Owners: mcepl
Branches: F-7 F-8
InitialCC: 
Cvsextras Commits: yes
Comment 9 Tim Lauridsen 2007-11-23 08:33:14 EST
> 
> That's incorrect -- I can and I should use what I did.
>
http://fedoraproject.org/wiki/PackagingDrafts/LicenseTag#head-35bf3683af78c7c47752f336efbee5029d35921a
> 'the spec must reflect this by using "or" as a separator.'
> 

Yes, you are right. 
Comment 10 Kevin Fenzi 2007-11-23 11:41:26 EST
cvs done.
Comment 11 Matěj Cepl 2007-11-23 12:20:13 EST
build done
http://koji.fedoraproject.org/koji/taskinfo?taskID=255762
Comment 12 Adam Miller 2010-05-07 13:04:02 EDT
Package Change Request
======================
Package Name: python-enum
New Branches: EL-5
Owners: maxamillion
Comment 13 Dennis Gilmore 2010-05-13 18:48:56 EDT
CVS Done
Comment 14 Adam Miller 2011-01-25 13:41:06 EST
Package Change Request
======================
Package Name: python-enum
New Branches: el6
Owners: maxamillion
Comment 15 Jason Tibbitts 2011-01-25 18:40:18 EST
Git done (by process-git-requests).
Comment 16 Adam Miller 2014-07-18 09:39:59 EDT
Package Change Request
======================
Package Name: python-enum
New Branches: epel7
Owners: maxamillion
Comment 17 Gwyn Ciesla 2014-07-18 10:54:51 EDT
Git done (by process-git-requests).

Note You need to log in before you can comment on or make changes to this bug.