Bug 378841

Summary: Review Request: python-rdflib - Python library for working with RDF
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: Package ReviewAssignee: Ruben Kerkhof <ruben>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: bnocera, davidf, fedora-package-review, j, notting, ruben
Target Milestone: ---Flags: ruben: fedora-review+
kevin: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-01 20:07:18 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:

Description Dave Malcolm 2007-11-12 21:42:10 UTC
Spec URL: http://people.redhat.com/dmalcolm/python/python-rdflib.spec
SRPM URL: http://people.redhat.com/dmalcolm/python/python-rdflib-2.4.0-1.src.rpm
Description:
RDFLib is a Python library for working with RDF, a simple yet powerful
language for representing information.

The library contains parsers and serializers for RDF/XML, N3, NTriples,
Turtle, TriX and RDFa. The library presents a Graph interface which can
be backed by any one of a number of store implementations, including
memory, MySQL, Redland, SQLite, Sleepycat, ZODB and SQLObject.

Comment 1 Jason Tibbitts 2007-11-18 07:43:01 UTC
This fails to build for me:

+ /usr/bin/python setup.py build

---------------------------------------------------------------------------
This script requires setuptools version 0.6c5 to run (even to display
help).  I will attempt to download it for you (from
[and so on]

Added a build dependency on python-setuptools; got further:

Ran 42 tests in 1.224s

FAILED (failures=3, errors=32)
error: Bad exit status from /var/tmp/rpm-tmp.63506 (%build)

First, shouldn't you call "setup.py test" in %check instead of %build?

There are well over a thousand lines of test failure backtraces; if you really
don't see these with a koji scratch build then I can attach the log.  Oh, heck,
since koji scratch bulds are so easy:
  koji build --scratch dist-f9 python-rdflib-2.4.0-1.fc9.src.rpm
gives:
  http://koji.fedoraproject.org/koji/taskinfo?taskID=246858
and one of the failing logs:
  http://koji.fedoraproject.org/koji/getfile?taskID=246861&name=build.log


Comment 2 Dave Malcolm 2007-11-19 22:49:26 UTC
Thanks for taking a look at this, and pointing out those mistakes.
  
I've fixed some of the problems, current status it's still failing, though it
does much better on F7 than on F9; I hope to provide better SRPMs in next few
days; hopefully at that point it will be worth taking another look at this review.

For reference:

F7 scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=248575
showing 1 test error here:
http://koji.fedoraproject.org/koji/getfile?taskID=248578&name=build.log

F9 scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=248563
showing 35 test errors here:
http://koji.fedoraproject.org/koji/getfile?taskID=248565&name=build.log

Comment 3 Ruben Kerkhof 2008-01-20 21:42:35 UTC
Hi Dave,

Have you managed to get those tests running?

Comment 4 Dave Malcolm 2008-01-22 19:55:19 UTC
I tried briefly this morning, but unsuccessfully, on an F8 box (python 2.5). 
When I originally wrote the specfile, it was on a RHEL5 box (python 2.4)

The errors seem to be with the way doctest strings are gathered: multiple
fragments of code within the same comment (separated by unindented comments)
build on each other, with later fragments referring to symbols in earlier
fragments.  So I suspect that something's changed with the way either nosetest
or doctests work, or it's a python 2.4 -> 2.5 thing.

I guess we can either try to fix this, or leave out the self tests for now.

Comment 5 Ruben Kerkhof 2008-01-22 22:25:05 UTC
You're right, only the doctests seem to fail.
Most of them seem rather buggy, for example:

[ruben@odin rdflib-2.4.0]$ nosetests rdflib/util.py
nose.config: INFO: Excluding tests matching ['(.*(store|mysql).*)']
Doctest: rdflib.util.date_time ... FAIL
Doctest: rdflib.util.parse_date_time ... ok

===============================================================
=======
FAIL: Doctest: rdflib.util.date_time
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.5/doctest.py", line 2112, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for rdflib.util.date_time
  File "/home/ruben/rpmbuild/BUILD/rdflib-2.4.0/rdflib/util.py", line 58, in date_time

----------------------------------------------------------------------
File "/home/ruben/rpmbuild/BUILD/rdflib-2.4.0/rdflib/util.py", line 64, in rdflib.util.date_time
Failed example:
    date_time(1126482850, local_time_zone=True)
Expected:
    '2005-09-11T19:54:10-04:00'
Got:
    '2005-09-12T01:54:10--2:00'


----------------------------------------------------------------------
Ran 2 tests in 0.064s

FAILED (failures=1)

That test depends on my local timezone.

So I think leaving them out is ok.

Comment 6 Jason Tibbitts 2008-07-03 01:44:08 UTC
Anything happening here?  It's been several months now.

Comment 7 Dave Malcolm 2008-07-03 14:26:50 UTC
Sorry, I investigated it, then dropped this on the floor.

I've added a macro to conditionalize running tests, turning it off for now. 
I've also deleted the "test" subdir from the payload, to avoid it polluting the
main python module namespace.

Updated specfile is at: http://people.redhat.com/dmalcolm/python/python-rdflib.spec
SRPM at: http://people.redhat.com/dmalcolm/python/python-rdflib-2.4.0-4.src.rpm

Successful scratch build in koji here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=694512

rpmlint on the built packages (on an EL5 box) gives me these errors:
rpmlint python-rdflib
python-rdflib.i386: E: non-executable-script
/usr/lib/python2.4/site-packages/rdflib/syntax/parsers/n3p/n3meta.py 0644
python-rdflib.i386: E: non-executable-script
/usr/lib/python2.4/site-packages/rdflib/syntax/parsers/ntriples.py 0644
python-rdflib.i386: E: non-executable-script
/usr/lib/python2.4/site-packages/rdflib/sparql/parser.py 0644
python-rdflib.i386: E: non-executable-script
/usr/lib/python2.4/site-packages/rdflib_tools/RDFPipe.py 0644
python-rdflib.i386: E: non-executable-script
/usr/lib/python2.4/site-packages/rdflib/syntax/parsers/n3p/n3p.py 0644
python-rdflib.i386: E: non-executable-script
/usr/lib/python2.4/site-packages/rdflib/syntax/parsers/n3p/uripath.py 0644
python-rdflib.i386: E: non-executable-script
/usr/lib/python2.4/site-packages/rdflib/syntax/parsers/n3p/n3proc.py 0644
as these modules have python shebang lines.  However, their __main__ routines
are either test code, or the RDFPipe.py, which is intended to be launched from
the /usr/bin/rdfpipe   So I believe these warnings are inconsequential.

How does this look to you?  Sorry again for the delay.

Comment 8 Ruben Kerkhof 2008-08-24 11:12:38 UTC
Hi Dave,

A few comments:
- You could probably remove the conditional %if 0%{?fedora} >= 8 since older versions are not supported anymore
- Permissions on SPARQLParserc.so are 0775 but should be 0755.
- Rpm adds SPARQLParserc.so to its provides list, but that library is not in a standard library location, and never meant to be used by other software. It probably can't do much harm, but it might be nice to override rpm's provide script for that, to avoid issues when another package decides to name a library SPARQLParserc.so

- For the other rpmlint warnings, you could either make those files executable or strip out the shebang line during install.

Comment 9 Bastien Nocera 2008-09-22 19:18:35 UTC
I'm interested in this package as a dependency for Totem's BBC provider plugin.

Comment 10 Dave Malcolm 2008-09-29 15:38:34 UTC
I've reviewed the various files that rpmlint flagged, and updated the specfile to make most of them executable (they contain unit tests and simple utilities), apart from one which isn't useful (removed shebang line).

I've kept the conditional %if 0%{?fedora} >= 8 to make it easier to share the specfile with EPEL5 (I'm actually doing this on an EL5 box).

I'm not seeing the SPARQLParserc.so permissions error on my local builds, and in my scratch build I'm seeing 0755.

Updated specfile here:
http://people.redhat.com/dmalcolm/python/python-rdflib.spec

and SRPM here:
http://people.redhat.com/dmalcolm/python/python-rdflib-2.4.0-5.src.rpm

Successful scratch build to dist-f9 here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=849950

Do you have some idea how to robustly strip that autogenerated "Provides: SPARQLParserc.so"?

Thanks

Comment 11 Ruben Kerkhof 2008-09-29 21:34:33 UTC
> I've reviewed the various files that rpmlint flagged, and updated the specfile
> to make most of them executable (they contain unit tests and simple utilities),
> apart from one which isn't useful (removed shebang line).

Great, thanks.

> I've kept the conditional %if 0%{?fedora} >= 8 to make it easier to share the
> specfile with EPEL5 (I'm actually doing this on an EL5 box).

Ah, that's ok.

> I'm not seeing the SPARQLParserc.so permissions error on my local builds, and
> in my scratch build I'm seeing 0755.

Not sure what's going on here, just did a rebuild in mock (rawhide):
ruben@slice python-rdflib]$ rpm -qplv python-rdflib-2.4.0-5.fc10.x86_64.rpm | grep SPARQLParserc.so
-rwxrwxr-x    1 root    root                   225544 Sep 29 23:13 /usr/lib64/python2.5/site-packages/rdflib/sparql/bison/SPARQLParserc.so

Not a big issue though, maybe it has something to do with my mock setup.

> Do you have some idea how to robustly strip that autogenerated "Provides:
> SPARQLParserc.so"?

Have a look at http://fedoraproject.org/wiki/PackagingDrafts/FilteringAutomaticDependencies

Comment 12 Dave Malcolm 2008-09-30 15:14:17 UTC
Thanks.

I've followed the instructions at the link you provided to filter out that overzealous autogenerated Provides.

Updated specfile at:
http://people.redhat.com/dmalcolm/python/python-rdflib.spec

Updated SRPM at:
http://people.redhat.com/dmalcolm/python/python-rdflib-2.4.0-6.src.rpm

Scratch built for dist-f9 succeeded:
http://koji.fedoraproject.org/koji/taskinfo?taskID=852460

Comment 13 Ruben Kerkhof 2008-10-01 11:38:07 UTC
Thanks Dave,

This package is approved.
Please correct the following warning before importing:
python-rdflib.src: W: mixed-use-of-spaces-and-tabs (spaces: line 8, tab: line 20)

Comment 14 Dave Malcolm 2008-10-01 17:57:42 UTC
New Package CVS Request
=======================
Package Name: python-rdflib
Short Description: Python library for working with RDF
Owners: dmalcolm
Branches: F-9 EL-5
InitialCC:

Comment 15 Kevin Fenzi 2008-10-01 19:09:29 UTC
cvs done.

Comment 16 Dave Malcolm 2008-10-01 20:07:18 UTC
Thanks.

I fixed the issue in comment 13 and I've imported the resulting srpm into each of devel, F-9, and EL-5.   I've built the package successfully in the devel and F-9 branches:
devel:
http://koji.fedoraproject.org/koji/taskinfo?taskID=855217

F-9: 
http://koji.fedoraproject.org/koji/taskinfo?taskID=855224

F-9 build submitted as new package update in Bodhi:
https://admin.fedoraproject.org/updates/python-rdflib-2.4.0-7.fc9

Closing this bug as NEXTRELEASE

Thanks everyone for your help.