Bug 1086844

Summary: Python 3 version of RDFLib
Product: [Fedora] Fedora Reporter: Dan Scott <dan>
Component: python-rdflibAssignee: Matthias Runge <mrunge>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dan, dmalcolm, hgkamath, mrunge, pingou
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-rdflib-4.1.2-3.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-05 12:58:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1031321, 1070074    
Bug Blocks: 1116470    
Attachments:
Description Flags
python-rdflib.spec
none
python3-rdflib-4.2.1-2.f21.src.rpm
none
python-rdflib.spec (comment 6)
none
python-rdflib.spec (comment 10) none

Description Dan Scott 2014-04-11 16:21:49 UTC
Description of problem: RDFLib supports both Python 2 and Python 3, but we only package a Python 2 version

Comment 1 Dan Scott 2014-04-11 16:22:58 UTC
We need a Python3 version of python-isodate (per bug 1031321) and also want to update python-rdflib to the latest 4.1.x version (per bug 1070074) before we can add Python3 support to python-rdflib.

Comment 2 Ganapathi Kamath 2014-07-04 20:59:56 UTC
Created attachment 914768 [details]
python-rdflib.spec

Attached spec file that builds python3-rdflib 
one changes the line of the previous spec file to 
Requires:      python3-rdflib

The trouble is -  
python3-selenium-2.40.0-2 depends on python-rdflib 
Bug 1116470 	

python3-rdflib and python-rdflib both install some files to
/usr/bin/csv2rdf
/usr/bin/rdf2dot
/usr/bin/rdfgraphisomorphism
/usr/bin/rdfpipe
/usr/bin/rdfs2dot
and so they clas with each other

Comment 3 Ganapathi Kamath 2014-07-04 21:01:35 UTC
$ rpm -qa | egrep -i isodate
python-isodate-0.5.0-1.fc20.noarch
python3-isodate-0.5.0-1.fc20.noarch

isodate is already there.

Comment 4 Ganapathi Kamath 2014-11-13 19:48:03 UTC
Created attachment 957279 [details]
python3-rdflib-4.2.1-2.f21.src.rpm

Attached python3-rdflib-4.2.1-2.f21.src.rpm   
Seems to build
A patch0 was made
It requires python3-SPARQLWrapper-1.6.4-1.f21.noarch from Bug 1089553 to be preinstalled  (this yet needs to be added to spec file as a requires)

Comment 5 Ganapathi Kamath 2014-11-13 23:48:39 UTC
Created attachment 957373 [details]
python-rdflib.spec (comment 6)

added a line is spec file to change the shebang python version
for i in `find . -name "*.py"` ; do sed -i -e "s/env python/env python3/g" "$i" ; done

Comment 6 Ganapathi Kamath 2014-11-14 00:03:54 UTC
sorry, that spec update didn't do it. python2.7 shebangs are creeping in from somewhere and I can't find it.

Comment 7 Ganapathi Kamath 2014-11-14 10:23:24 UTC
I think the shebang is made when creating the rpm during the _bindir 
changing the shebang to python3 after rpm installation on about 5 tools that are installed in /usr/bin is all that is needed. 

This is just to carify that the rest of all the rdflib rpm goes to the python3 sitelib, and the simple rdf programs seem to work.

Comment 8 Matthias Runge 2014-11-28 10:54:19 UTC
Ganapathi, thank you for looking into this.

you'll need to rename python3 binaries (what goes to /usr/bin/ to something else, like python3-csv2rdf.
Otherwise, those scripts will be overwritten by their python2.7 counterparts.

Comment 9 Matthias Runge 2014-12-16 10:34:29 UTC
any progress here?

Comment 10 Ganapathi Kamath 2014-12-24 18:43:53 UTC
Created attachment 972803 [details]
python-rdflib.spec (comment 10)

spec file to rename console-scripts to be suffixed with 'python3-'

It was probably an atrpms-rpm-config-204-1.noarch.rpm macro python_burninversion.sh that kept overwriting the shebang which I uninstalled.

Comment 11 Matthias Runge 2015-01-05 12:58:25 UTC
OK, I finally went ahead and used my proven packager powers to do

http://pkgs.fedoraproject.org/cgit/python-rdflib.git/commit/python-rdflib.spec?id=25a74e43449158312aefd1da04b672d4c3b5f6c8

Comment 12 Fedora Update System 2015-03-19 09:19:22 UTC
python-rdflib-4.1.2-3.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/python-rdflib-4.1.2-3.fc21

Comment 13 Fedora Update System 2015-04-08 06:58:38 UTC
python-rdflib-4.1.2-3.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.