Re-inventing Python Packaging & Testing (0.9)

Holger Krekel, http://twitter.com/hpk42

Pycon Russia, Ekaterinburg, 25th Feb 2013

(XKCD of course)

Very happy to be here!

My background

And now for something completely different

Remember

Perl:

There is more than one way to do it.

Python:

There should be one -- and preferably only one -- obvious way to do it.

Second version syndrome

Python3 may have beaten Perl6

(from theregister.co.uk)

but Perl is coming back to haunt us ...

Comprehensive Perl Archive network (CPAN)

cpan.pm comes with base Perl installs:

CPAN server / uploading

PAUSE is the upload server for perl packages:

Python Installer situation Feb 2013

upload/PYPI server interaction today

and as to mirrors ...

CPAN Mirror status

(http://mirrors.cpan.org/ )

PyPI Mirror status

(http://www.pypi-mirrors.org )

We can stop the comparison already ...

(from www.cavstheblog.com)

Three Lessons learned

Comparing with others can quickly make you unhappy

Perl and Python both not living up to their mantras

There is a lot to improve on

Python Tools and PEPs to improve

beware: the standardization trap

(one of the many great XKCD comics)

To avoid the standardization trap:

Don't demand that the world changes first

before your tool/idea can be used

(was also my motto when starting PyPy)

Rather: write meta tools

example from the testing arena

(you do know the goat is Python's testing mascott, right?)

Python Testing tools

Would inventing a new test runner help to standardize testing?

tox: a "meta" test running tool

mission: standardize testing in Python

See http://tox.testrun.org for details.

But that's about testing ...

what about packaging/pypi?

I did a little prototyping ...

shown first here at Pycon Russia :)

devpi: a meta tool for packaging activities

devpi serves two purposes:

why a new approach to index serving?

there is no good existing pypi server to build these features:

Open Source principle:

talk is cheap, show working code!

$ devpi server

enough theory - on to a a little demo :)

summary of devpi server demo insights

but:

typing in index server urls, maintaining .pypirc config is burdensome with multiple indexes ... therefore ...

devpi also provides "workflow" subcommands

use      set current pypi index

install  download and install one or more packages

upload   build and upload packages from a checkout

test     download and test a package

push     push a package to another index

$ devpi test

example:

$ devpi test -e py25,py33 mypkg

$ devpi push

example:

$ devpi push mypkg https://pypi.python.org

devpi: typical Open Source work flow

  1. start a localhost index server:
    $ devpi server
  2. use a user-specific index:

    $ devpi use http://localhost:3141/~hpk42/dev/

  3. upload a package from a checkout:
    $ devpi upload
  4. perform tests on multiple machines from multiple users:
    $ devpi test PKGNAME
  5. test results at http://localhost:3141/~hpk42/dev/tests
  6. when release is ready:
    $ devpi push PKG https://pypi.python.org

devpi implementation plan

my priorities

use cases from contracting companies

use cases from my and others open source work

Open areas / future work

devpi going public mid 2013 ...

aiming for a <1.0 public release, to involve early adopters and contributors for finalizing processes and good defaults.

Approach me here at Pycon Russia 2013

and thanks for listening!

No public channels yet, but am going to announce them via:

SpaceForward
Left, Down, Page DownNext slide
Right, Up, Page UpPrevious slide
POpen presenter console
HToggle this help