Bug 1192111

Summary: Build nfs-utils with Python 3
Product: [Fedora] Fedora Reporter: Bohuslav "Slavek" Kabrda <bkabrda>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: bfields, bkabrda, jlayton, mhroncok, rkuska, steved
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-1.3.2-11.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-26 21:52:46 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:    
Bug Blocks: 1014209, 1194577    
Attachments:
Description Flags
Use python 3 explicitly in nfs-utils scripts
none
Patch for specfile to replace all shebangs to Python 3 none

Description Bohuslav "Slavek" Kabrda 2015-02-12 16:04:02 UTC
Hi, as per [1], I'd like to ask you to switch to building with Python 3. nfs-utils upstream is Python 3 compatible, so this should be a simple matter of switching from Python 2 to Python 3. Please do this for both F22 and rawhide. Feel free to contact me if you need help.
Note: the only thing causing dependency of Python 2 is the "#!/usr/bin/python" hashbang in several scripts - you should just replace it with "#!/usr/bin/python3".
Thanks.

[1] https://fedoraproject.org/wiki/Changes/Python_3_Migration_Improvements

Comment 1 Steve Dickson 2015-02-12 17:04:49 UTC
(In reply to Bohuslav "Slavek" Kabrda from comment #0)
> Hi, as per [1], I'd like to ask you to switch to building with Python 3.
> nfs-utils upstream is Python 3 compatible, so this should be a simple matter
> of switching from Python 2 to Python 3. Please do this for both F22 and
> rawhide. Feel free to contact me if you need help.
> Note: the only thing causing dependency of Python 2 is the
> "#!/usr/bin/python" hashbang in several scripts - you should just replace it
> with "#!/usr/bin/python3".
> Thanks.
> 
> [1] https://fedoraproject.org/wiki/Changes/Python_3_Migration_Improvements

Could you give me a patch(s) of what you are looking for?

Comment 2 Bohuslav "Slavek" Kabrda 2015-02-18 09:58:51 UTC
Created attachment 993042 [details]
Use python 3 explicitly in nfs-utils scripts

Something like this should do the trick.

Comment 3 Steve Dickson 2015-02-19 15:55:53 UTC
(In reply to Bohuslav "Slavek" Kabrda from comment #2)
> Created attachment 993042 [details]
> Use python 3 explicitly in nfs-utils scripts
> 
> Something like this should do the trick.

From our IRC conversation you are suggesting this change does not 
need to go upstream? I'm not sure diverting from upstream is
a good idea...

Comment 4 Bohuslav "Slavek" Kabrda 2015-02-20 07:32:00 UTC
(In reply to Steve Dickson from comment #3)
> (In reply to Bohuslav "Slavek" Kabrda from comment #2)
> > Created attachment 993042 [details]
> > Use python 3 explicitly in nfs-utils scripts
> > 
> > Something like this should do the trick.
> 
> From our IRC conversation you are suggesting this change does not 
> need to go upstream? I'm not sure diverting from upstream is
> a good idea...

I don't think it needs to go there. There are still distros that don't ship Python 3 and upstream may want to stay compatible with them out of the box. Having Python 3 as default is Fedora's downstream change, so IMO this is ok to keep downstream.

Comment 5 Bohuslav "Slavek" Kabrda 2015-02-23 07:04:22 UTC
Steve, can this be built today, please? I really need to have this finished by tomorrow because of change freeze deadline. I uploaded a srpm with the patch to my fedorapeople space [1], you can just "fedpkg import" it and build on rawhide and F22. Thanks.

[1] https://bkabrda.fedorapeople.org/nfs-utils-1.3.2-0.3.fc23.src.rpm

Comment 6 Bohuslav "Slavek" Kabrda 2015-02-23 12:21:54 UTC
Ok, so it seems that we'll have to revert after all for F22 [1]. Please only build this for F23 (so this doesn't need to be built today). Thanks.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1194577#c4

Comment 7 Steve Dickson 2015-03-06 13:36:57 UTC
(In reply to Bohuslav "Slavek" Kabrda from comment #6)
> Ok, so it seems that we'll have to revert after all for F22 [1]. Please only
> build this for F23 (so this doesn't need to be built today). Thanks.
> 
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1194577#c4

This being the case I will not make this change until f22 is released
because I like to git cherry-pick between rawhide and the pre-released
branch (in this case f22)

Comment 8 Bohuslav "Slavek" Kabrda 2015-03-06 13:45:40 UTC
(In reply to Steve Dickson from comment #7)
> (In reply to Bohuslav "Slavek" Kabrda from comment #6)
> > Ok, so it seems that we'll have to revert after all for F22 [1]. Please only
> > build this for F23 (so this doesn't need to be built today). Thanks.
> > 
> > [1] https://bugzilla.redhat.com/show_bug.cgi?id=1194577#c4
> 
> This being the case I will not make this change until f22 is released
> because I like to git cherry-pick between rawhide and the pre-released
> branch (in this case f22)

Ok, that's fine by me. Thanks!

Comment 9 Robert Kuska 2015-07-03 07:44:35 UTC
Hi Steve,

please switch the shebang of mountstats to /usr/bin/python3. Our system wide change was accepted by FESCO for Fedora23.

Comment 10 Miro Hrončok 2015-07-13 15:05:44 UTC
Created attachment 1051456 [details]
Patch for specfile to replace all shebangs to Python 3

This is a patch for nfs-utils.spec that changes all the shebangs to /usr/bin/python3. I've also made a scratch build here:

http://koji.fedoraproject.org/koji/taskinfo?taskID=10340142

Comment 11 Miro Hrončok 2015-07-17 09:37:11 UTC
Would you mind if I push this to dist git?

Comment 12 Steve Dickson 2015-07-18 14:21:21 UTC
(In reply to Miro Hrončok from comment #11)
> Would you mind if I push this to dist git?

Shouldn't this go through upstream first or is
a fedora only thing (which I hope is not the case)?

Comment 13 Miro Hrončok 2015-07-18 16:39:43 UTC
Upstream now supports both Python 2 and Python 3. It's downstream's choice what version to use and unfortunately, the shebang line has to be set manually.

Comment 14 Miro Hrončok 2015-07-23 08:38:37 UTC
Steve? Alpha freeze is on Tuesday, I'd prefer not to do this the last day possible.

Comment 15 Miro Hrončok 2015-07-26 21:52:46 UTC
OK, since the alpha freeze is coming and I haven't hear a reply, I've built it.

The rawhide build failed, probably because of new rpm, open a bz1246911.