Python on the move
The state of mobile Python
Dr Russell Keith-Magee
Vancouver PyDay 2015
Slide 2
Slide 2 text
Python on the move
The state of mobile Python
Dr Russell Keith-Magee
Vancouver PyDay 2015
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
No content
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
No content
Slide 7
Slide 7 text
toga
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
What is "Mobile Python"?
Slide 10
Slide 10 text
Mobile devices
don't have TTYs
Slide 11
Slide 11 text
Functionality delivered as
apps, not common services
Slide 12
Slide 12 text
My position:
“Mobile Python”
means
“Embedded only” Python
Slide 13
Slide 13 text
My position:
“Mobile Python”
means
“Embedded only” Python
Slide 14
Slide 14 text
Python means cross platform
Slide 15
Slide 15 text
iOS and Android
Slide 16
Slide 16 text
iOS
Hardware: ARMv6, ARMv7, ARMv7s, ARM64
Testing on i386/x86-64 Simulator
Clang toolchain
Fat binaries
Objective-C native libraries
No dynamic linking
Submission through App Store
Slide 17
Slide 17 text
iOS
Hardware: ARMv6, ARMv7, ARMv7s, ARM64
Testing on i386/x86-64 Simulator
Clang toolchain
Fat binaries
Objective-C native libraries
No dynamic linking
Submission through App Store
Slide 18
Slide 18 text
iOS
Hardware: ARMv6, ARMv7, ARMv7s, ARM64
Testing on i386/x86-64 Simulator
Clang toolchain
Fat binaries
Objective-C native libraries
No dynamic linking
Submission through App Store
Slide 19
Slide 19 text
iOS
Hardware: ARMv6, ARMv7, ARMv7s, ARM64
Testing on i386/x86-64 Simulator
Clang toolchain
Fat binaries
Objective-C native libraries
No dynamic linking
Submission through App Store
Slide 20
Slide 20 text
iOS
Hardware: ARMv6, ARMv7, ARMv7s, ARM64
Testing on i386/x86-64 Simulator
Clang toolchain
Fat binaries
Objective-C native libraries
No dynamic linking
Submission through App Store
Slide 21
Slide 21 text
iOS
Hardware: ARMv6, ARMv7, ARMv7s, ARM64
Testing on i386/x86-64 Simulator
Clang toolchain
Fat binaries
Objective-C native libraries
No dynamic linking
Submission through App Store
Slide 22
Slide 22 text
iOS
Hardware: ARMv6, ARMv7, ARMv7s, ARM64
Testing on i386/x86-64 Simulator
Clang toolchain
Fat binaries
Objective-C native libraries
No dynamic linking
Submission through App Store
Slide 23
Slide 23 text
Jailbreaking
Slide 24
Slide 24 text
Android
Hardware: ARM, ARM64, i386, MIPS
Testing via device emulator
Java toolchain
Native code via JNI
Single target binaries
Submission through Google Play Store
Slide 25
Slide 25 text
Android
Hardware: ARM, ARM64, i386, MIPS
Testing via device emulator
Java toolchain
Native code via JNI
Single target binaries
Submission through Google Play Store
Slide 26
Slide 26 text
Android
Hardware: ARM, ARM64, i386, MIPS
Testing via device emulator
Java toolchain
Native code via JNI
Single target binaries
Submission through Google Play Store
Slide 27
Slide 27 text
Android
Hardware: ARM, ARM64, i386, MIPS
Testing via device emulator
Java toolchain
Native code via JNI
Single target binaries
Submission through Google Play Store
Slide 28
Slide 28 text
Android
Hardware: ARM, ARM64, i386, MIPS
Testing via device emulator
Java toolchain
Native code via JNI
Single target binaries
Submission through Google Play Store
Slide 29
Slide 29 text
Android
Hardware: ARM, ARM64, i386, MIPS
Testing via device emulator
Java toolchain
Native code via JNI
Single target binaries
Submission through Google Play Store
Slide 30
Slide 30 text
So can I
Python my phone?
Slide 31
Slide 31 text
iOS
Patch available for CPython 3.4.2
Python issue23670
On OS/X with XCode: cd iOS && make
spits out Python.framework
Fully passes test suite on Simulator
many capabilities disabled
5 failing tests on ARM64 devices
3 failing tests on ARMv7/ARMv7S devices
Slide 32
Slide 32 text
iOS
Patch available for CPython 3.4.2
Python issue23670
On OS/X with XCode: cd iOS && make
spits out Python.framework
Fully passes test suite on Simulator
many capabilities disabled
5 failing tests on ARM64 devices
3 failing tests on ARMv7/ARMv7S devices
Slide 33
Slide 33 text
iOS
Patch available for CPython 3.4.2
Python issue23670
On OS/X with XCode: cd iOS && make
spits out Python.framework
Fully passes test suite on Simulator
many capabilities disabled
5 failing tests on ARM64 devices
3 failing tests on ARMv7/ARMv7S devices
Slide 34
Slide 34 text
iOS
Patch available for CPython 3.4.2
Python issue23670
On OS/X with XCode: cd iOS && make
spits out Python.framework
Fully passes test suite on Simulator
many capabilities disabled
5 failing tests on ARM64 devices
3 failing tests on ARMv7/ARMv7S devices
Slide 35
Slide 35 text
iOS
Patch available for CPython 3.4.2
Python issue23670
On OS/X with XCode: cd iOS && make
spits out Python.framework
Fully passes test suite on Simulator
many capabilities disabled
5 failing tests on ARM64 devices
9 failing tests on ARMv7/ARMv7S devices
Slide 36
Slide 36 text
iOS - problems to solve
Python issue22625 - cross-platform build
support
libffi
Shepherding the commit
Slide 37
Slide 37 text
iOS - problems to solve
Python issue22625 - cross-platform build
support
libffi
Shepherding the commit
Slide 38
Slide 38 text
iOS - problems to solve
Python issue22625 - cross-platform build
support
libffi
Shepherding the commit
Slide 39
Slide 39 text
iOS - problems to solve
Python issue22625 - cross-platform build
support
libffi
Shepherding the commit
Slide 40
Slide 40 text
Android
Patch available for CPython 3.4.2
Python issue23496
Not yet complete
Kivy has a working 2.7.6 compile, so it can be
done.
Slide 41
Slide 41 text
Android - problems to solve
Python issue22625 - cross-platform build
support
libffi
CPython vs Java
Why not Jython?
Making an iOS project
cookiecutter http://github.com/pybee/Python-
iOS-template
Download support tarball from
http://github.com/Python-iOS-support
Unpack tarball
Compile and run
Slide 70
Slide 70 text
Making an Android project
cookiecutter http://github.com/pybee/Python-
Android-template
Download support tarball from
http://github.com/Python-Android-support
Unpack tarball
Compile and run