Slide 1

Slide 1 text

Python Packaging in Fedora Petr Viktorin [email protected] Flock, 2016-08-02

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

I. Python 3

Slide 4

Slide 4 text

Python 1991 Java 1995

Slide 5

Slide 5 text

Python 1991 Java 1995 Python 3.0 2008 Node.js 2009

Slide 6

Slide 6 text

Python 1991 Java 1995 Python 3.0 2008 Node.js 2009 Python 3.5 2015

Slide 7

Slide 7 text

Python 1991 Java 1995 Python 3.0 2008 Node.js 2009 Python 3.5 2015 Python 2 EOL 2020

Slide 8

Slide 8 text

Python 3 Porting Database http://fedora.portingdb.xyz

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

at least 49,9% of Python software packaged in Fedora supports Python 3

Slide 11

Slide 11 text

at least 49,9% of Python software packaged in Fedora supports Python 3 45,5% has the Py 3 version packaged

Slide 12

Slide 12 text

Help us port! 3 PYTHON3 PYTHON3 PYTHON http://fedora.portingdb.xyz

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Fedora infra Desktop toolkits Big non-Python apps

Slide 15

Slide 15 text

I. Python 3 II. Automating Packaging

Slide 16

Slide 16 text

A packager should: 1. Make sure SW plays nice 2. Integrate with rest of system 3. Check licenses, patents, etc.

Slide 17

Slide 17 text

A packager should: 1. Make sure SW plays nice 2. Integrate with rest of system 3. Check licenses, patents, etc. 4. Read 50 pages of guidelines 5. Know a weird macro language

Slide 18

Slide 18 text

%global pypi_name mypkg Name: python -%{pypi_name} Version: 2.4.25.1 Release: 1%{?dist} License: Python URL: https://github.com /%{pypi_name}/%{pypi_name} Source0: https://pypi.python .org/packages/source/p/%{ pypi_name}/%{pypi_name}-%{version }.tar.gz

Slide 19

Slide 19 text

%if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global \ __python2 /usr/bin/python2} %{!?python2_sitelib: %global \ python2_sitelib %(%{__python2} -c %endif %if 0%{?fedora} > 12 || 0%{?rhel} > %global with_python3 1 %global __python3 python3 %endif

Slide 20

Slide 20 text

from distutils.core import setup setup( name='mypkg ', version='2.4.25.1', author='Me', url='github.com/me/mypkg/', packages=['mypkg '], install_requires=['six '], )

Slide 21

Slide 21 text

Enter pyp2rpm # dnf install /usr/bin/pyp2rpm $ pyp2rpm mypkg

Slide 22

Slide 22 text

Enter pyp2rpm # dnf install /usr/bin/pyp2rpm $ pyp2rpm mypkg It might actually work!

Slide 23

Slide 23 text

We can use pyp2rpm to... Auto-build all of PyPI in COPR!

Slide 24

Slide 24 text

We can use pyp2rpm to... Auto-build all of PyPI in COPR! Why?

Slide 25

Slide 25 text

We can use pyp2rpm to... Auto-build all of PyPI in COPR! Why? - Test pyp2rpm

Slide 26

Slide 26 text

We can use pyp2rpm to... Auto-build all of PyPI in COPR! Why? - Test pyp2rpm - Run upstream tests

Slide 27

Slide 27 text

We can use pyp2rpm to... Auto-build all of PyPI in COPR! Why? - Test pyp2rpm - Run upstream tests - Provide a repository

Slide 28

Slide 28 text

dnf pip install -r requirements.txt (hypothetical command)

Slide 29

Slide 29 text

“PyPI” name Fedora pkg pyopencl python3-pyopencl mypy-lang python3-mypy

Slide 30

Slide 30 text

“PyPI” name Fedora pkg pyopencl python3-pyopencl mypy-lang python3-mypy $ dnf repoquery --provides python3 -pyopencl ... python3.5dist(pyopencl) = 2015.2 ...

Slide 31

Slide 31 text

“PyPI” name Fedora pkg pyopencl python3-pyopencl mypy-lang python3-mypy $ dnf repoquery --provides python3 -pyopencl ... python3.5dist(pyopencl) = 2015.2 ... Live in Fedora 25!

Slide 32

Slide 32 text

I. Python 3 II. Automating Packaging III. System Python

Slide 33

Slide 33 text

System Python /usr/libexec/system-python An effort to minimize minimal installs (cloud images)

Slide 34

Slide 34 text

Python stdlib by disk size test asyncio email tkinter encodings distutils unittest pydoc_data ensurepip ctypes lib2to3 idlelib individual modules

Slide 35

Slide 35 text

System Python libs /usr/libexec/system-python /usr/lib/python3.5/ lib2to3 unittest venv ensurepip pydoc encodings sqlite3 collections logging distutils html test tkinter turtledemo idlelib system-python-libs python3-libs python3-test python3-tkinter python3 system-python /usr/bin/python3

Slide 36

Slide 36 text

Possible users: DNF, cloud-init

Slide 37

Slide 37 text

Possible users: DNF, cloud-init Future: Isolation of system tools?

Slide 38

Slide 38 text

I. Python 3 II. Automating Packaging III. System Python IV. Python 3.6

Slide 39

Slide 39 text

Python 3.6 * Format Strings * Large Speedups * Advanced class creation tools

Slide 40

Slide 40 text

Python 3.6 Alpha 1 2016-05-17 Fedora 25 Alpha Freeze 2016-08-09

Slide 41

Slide 41 text

Python 3.6 Alpha 1 2016-05-17 Fedora 25 Alpha Freeze 2016-08-09 Python 3.6 Beta 1 2016-09-12 Fedora 25 Beta Freeze 2016-09-20

Slide 42

Slide 42 text

Python 3.6 Alpha 1 2016-05-17 Fedora 25 Alpha Freeze 2016-08-09 Python 3.6 Beta 1 2016-09-12 Fedora 25 Beta Freeze 2016-09-20 Python 3.6 RC 1 2016-12-05 Fedora 25 Final Freeze 2016-10-25

Slide 43

Slide 43 text

Python 3.6 Alpha 1 2016-05-17 Fedora 25 Alpha Freeze 2016-08-09 Python 3.6 Beta 1 2016-09-12 Fedora 25 Beta Freeze 2016-09-20 Python 3.6 RC 1 2016-12-05 Fedora 25 Final Freeze 2016-10-25 Python 3.6 Final 2016-12-16 Fedora 26 Branches 2016-12-???

Slide 44

Slide 44 text

I. Python 3 II. Automating Packaging III. System Python IV. Python 3.6 V. Who's “we”?

Slide 45

Slide 45 text

python-maint @ Red Hat

Slide 46

Slide 46 text

python-maint @ Red Hat

Slide 47

Slide 47 text

python-maint @ Red Hat

Slide 48

Slide 48 text

python-maint @ Red Hat

Slide 49

Slide 49 text

python-maint @ Red Hat

Slide 50

Slide 50 text

python-maint @ Red Hat

Slide 51

Slide 51 text

Sorry! We'll do better!

Slide 52

Slide 52 text

We're Python SIG python-devel @lists.fedoraproject.org #fedora-python on Freenode fedora-python on Github

Slide 53

Slide 53 text

I. Python 3 II. Automating Packaging III. System Python IV. Python 3.6 V. Who's “we”?