Bug 395651 - Review Request: python-enum - Robust enumerated type support in Python
Summary: Review Request: python-enum - Robust enumerated type support in Python
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Lauridsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-22 13:32 UTC by Matěj Cepl
Modified: 2018-04-11 18:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-23 17:20:13 UTC
Type: ---
Embargoed:
tim.lauridsen: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)

Description Matěj Cepl 2007-11-22 13:32:45 UTC
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 13:34:23 UTC
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 13:55:22 UTC
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 05:06:44 UTC
? 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 05:28:24 UTC
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 06:40:03 UTC
* 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 11:33:38 UTC
(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 11:49:58 UTC
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 13:33:14 UTC
> 
> 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 16:41:26 UTC
cvs done.

Comment 11 Matěj Cepl 2007-11-23 17:20:13 UTC
build done
http://koji.fedoraproject.org/koji/taskinfo?taskID=255762

Comment 12 Adam Miller 2010-05-07 17:04:02 UTC
Package Change Request
======================
Package Name: python-enum
New Branches: EL-5
Owners: maxamillion

Comment 13 Dennis Gilmore 2010-05-13 22:48:56 UTC
CVS Done

Comment 14 Adam Miller 2011-01-25 18:41:06 UTC
Package Change Request
======================
Package Name: python-enum
New Branches: el6
Owners: maxamillion

Comment 15 Jason Tibbitts 2011-01-25 23:40:18 UTC
Git done (by process-git-requests).

Comment 16 Adam Miller 2014-07-18 13:39:59 UTC
Package Change Request
======================
Package Name: python-enum
New Branches: epel7
Owners: maxamillion

Comment 17 Gwyn Ciesla 2014-07-18 14:54:51 UTC
Git done (by process-git-requests).


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