Slide 1

Slide 1 text

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?

Slide 42

Slide 42 text

Why not Jython?

Slide 43

Slide 43 text

Why not Jython?

Slide 44

Slide 44 text

Why not Jython?

Slide 45

Slide 45 text

Why not Jython?

Slide 46

Slide 46 text

Something else?

Slide 47

Slide 47 text

Something else?

Slide 48

Slide 48 text

Byterun https://github.com/nedbat/byterun

Slide 49

Slide 49 text

VOC https://github.com/pybee/voc

Slide 50

Slide 50 text

https://github.com/pybee/voc

Slide 51

Slide 51 text

(rimshot)

Slide 52

Slide 52 text

https://github.com/pybee/voc Vestigial Output Compiler Vexing Obtuse Compiler Valuable Obscure Compiler Varigated Ocelot Calibrator

Slide 53

Slide 53 text

But wait...

Slide 54

Slide 54 text

Bridges: iOS PyObjC Rubicon Objective C PyObjus

Slide 55

Slide 55 text

Bridges: iOS PyObjC Rubicon Objective C PyObjus

Slide 56

Slide 56 text

Bridges: iOS PyObjC Rubicon Objective-C PyObjus

Slide 57

Slide 57 text

Bridges: Android CPython Rubicon Java PyJNIus Jython clamp

Slide 58

Slide 58 text

Widgets

Slide 59

Slide 59 text

1. Go native

Slide 60

Slide 60 text

2. Kivy

Slide 61

Slide 61 text

2. Kivy

Slide 62

Slide 62 text

2. Kivy

Slide 63

Slide 63 text

2. Kivy

Slide 64

Slide 64 text

2. Kivy

Slide 65

Slide 65 text

2. Kivy

Slide 66

Slide 66 text

2. Kivy

Slide 67

Slide 67 text

3. Toga

Slide 68

Slide 68 text

Making it easy.

Slide 69

Slide 69 text

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

Slide 71

Slide 71 text

Option 1a pip install briefcase python setup.py ios python setup.py android

Slide 72

Slide 72 text

python setup.py osx

Slide 73

Slide 73 text

The future

Slide 74

Slide 74 text

The future

Slide 75

Slide 75 text

The threat

Slide 76

Slide 76 text

The threat

Slide 77

Slide 77 text

The opportunity

Slide 78

Slide 78 text

The opportunity

Slide 79

Slide 79 text

The potential and the potential audience for a Mobile Python is huge.

Slide 80

Slide 80 text

Python Mobile-SIG [email protected] @freakboy3742 pybee.org @PyBeeWare