Bug 1241947 - Switch atomic to use python3
Summary: Switch atomic to use python3
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: atomic
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lokesh Mandvekar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F23PYTHON3
TreeView+ depends on / blocked
 
Reported: 2015-07-10 13:19 UTC by Miro Hrončok
Modified: 2015-07-23 18:12 UTC (History)
5 users (show)

Fixed In Version: atomic-0-0.12.gitfea1b99.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-17 17:34:30 UTC


Attachments (Terms of Use)
Patch for specfile to use Python 3 (2.81 KB, patch)
2015-07-14 12:25 UTC, Miro Hrončok
no flags Details | Diff
Patch for specfile to use Python 3 (with bytecompilation fix) (2.84 KB, patch)
2015-07-14 12:42 UTC, Miro Hrončok
no flags Details | Diff
Patch for specfile to use Python 3 (2.71 KB, patch)
2015-07-14 12:59 UTC, Miro Hrončok
no flags Details | Diff
Patch for specfile to use Python 3 (2.84 KB, patch)
2015-07-17 09:43 UTC, Miro Hrončok
no flags Details | Diff

Description Miro Hrončok 2015-07-10 13:19:58 UTC
Support for Python 3 has been added to atomic [1]. System wide change for Fedora 23 was accepted by FESCo which implies that all packages on Live CD and other install media (including Atomic host) must run on Python 3 and not Python 2 [2].

Please update and change the atomic package so it uses Python 3.

In case you don't have time/resources to do this in time before F23 Alpha freeze [3], I can do it myself, please let me know if that's acceptable.

[1] https://github.com/projectatomic/atomic/commit/5dd9bb27a2832c3cf08cec29708d77a662181f37
[2] https://fedoraproject.org/wiki/Changes/Python_3_as_Default
[3] https://fedoraproject.org/wiki/Releases/23/Schedule

Comment 1 Daniel Walsh 2015-07-10 14:47:50 UTC
lokesh can we do this via scripting?  

make PYTHON=python3 install

Gets us most of the way their.  The only change required is to modify /usr/bin/python to /usr/bin/python3

diff --git a/atomic b/atomic
index 6713819..261f832 100755
--- a/atomic
+++ b/atomic
@@ -1,4 +1,4 @@
-#!/usr/bin/python -Es
+#!/usr/bin/python3 -Es
 # Copyright (C) 2014-2015 Red Hat
 # AUTHOR: Dan Walsh <dwalsh@redhat.com>
 # see file 'COPYING' for use and warranty information

Comment 2 Miro Hrončok 2015-07-14 12:25:45 UTC
Created attachment 1051816 [details]
Patch for specfile to use Python 3

I've updated the package and switched it to Python 3.

Note that it fails to build on arm, due to missing docker, but I didn't want to remove it from ExclusiveArch, I guess that's your call.

Koji scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=10352602

Comment 3 Daniel Walsh 2015-07-14 12:36:28 UTC
Most of your changes should not be necessary if you call

make PYTHON=python3 install

We should not be modifying the Makefile in the specfile.  We should use environment variables that the specfile can set.

Comment 4 Miro Hrončok 2015-07-14 12:39:03 UTC
And I forgot one thing, /usr/share/atomic/atomic_dbus.py is now bytecompiled with Python 2, I'll fix that.

Comment 5 Miro Hrončok 2015-07-14 12:41:17 UTC
(In reply to Daniel Walsh from comment #3)
> Most of your changes should not be necessary if you call
> 
> make PYTHON=python3 install
I do exactly that. What changes exactly should not be necessary?

> We should not be modifying the Makefile in the specfile.  We should use
> environment variables that the specfile can set.

The only modifying of Makefile is about pylint. Feel free to fix this upsream, not much that can be done form the spec file, when there is no environment variable about pylint used in there.

Comment 6 Miro Hrončok 2015-07-14 12:41:45 UTC
s/form the spec file/from the spec file/

Comment 7 Miro Hrončok 2015-07-14 12:42:33 UTC
Created attachment 1051832 [details]
Patch for specfile to use Python 3 (with bytecompilation fix)

Koji scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=10352768

Comment 8 Daniel Walsh 2015-07-14 12:47:46 UTC
sed -i 's/pylint/python3-pylint/' Makefile

This should be fixed upstream.  Send a patch to Atomic, or I will just throw a fix in.

	

sed -i 's|#!/usr/bin/python|#!%{__python3}|' atomic

This should not be necessary, since the setup.py does it automatically.

make PYTHON=%{__python3} install

Will cause setup.py to install atomic and atomic_dbus.py with /bin/python3

Comment 9 Miro Hrončok 2015-07-14 12:59:20 UTC
Created attachment 1051835 [details]
Patch for specfile to use Python 3

Right.

Comment 10 Daniel Walsh 2015-07-14 13:25:37 UTC
Miro, That looks a lot better.

Would love to get rid of 

sed -i '/pylint/d' Makefile

Comment 11 Miro Hrončok 2015-07-17 09:43:20 UTC
Created attachment 1053036 [details]
Patch for specfile to use Python 3

Me too. Here we go. Shall I push this?

Comment 12 Daniel Walsh 2015-07-17 12:49:25 UTC
Looks good to me.

Comment 13 Miro Hrončok 2015-07-17 13:46:19 UTC
Oh, so I was too quick closing this.

There is still problem with docker on ARM.

Error: No Package found for docker

Should I disable ARM builds?

Comment 14 Daniel Walsh 2015-07-17 15:43:12 UTC
I guess so, until Lokesh starts building docker for arm.

Comment 15 Miro Hrončok 2015-07-17 17:34:30 UTC
Ok, done that.

Comment 16 Lokesh Mandvekar 2015-07-23 18:12:30 UTC
arm builds were enabled earlier, though iirc I had to disable them for rawhide coz of build problems. I'll check again and enable it if all goes well.


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