How to best package your library?

Bernát Gábor

Abstract

Join me in finding out how you can achieve sharing code across projects by creating libraries. We'll learn about how the cheese shop, pip, twine, setuptools, flit and poetry all fit together (past, present, and future); and how the infamous PEP-517 and PEP-518 try to improves the packaging domain.

Description

One of the most fundamental principles of programming is "don't repeat yourself." Join me in finding out how you can achieve sharing code across projects by creating libraries and what tools/components you can use. We'll learn about how the cheese shop, pip, twine, setuptools, flit and poetry all fit together (past, present, and future); and how the infamous PEP-517 and PEP-518 try to make this a much more pleasant experience for everyone.

I am targeting this talk at developers who have some level of Python knowledge and want to find out what's the best way to package and distribute their libraries. It will also help developers who have been using setuptools happily for the last few years, but want to learn about other ways to do this (aka choose the best tool for the situation - rather than choose whatever your hammer is). People will leave the talk with a good grasp of the state of the Python packaging ecosystem and where it is heading. A concise outline goes as follows:

  • How to share code - quick, high-level overview of libraries
  • What is a library
  • The difference between source tree/VCS/source distribution/wheel
  • How we share libraries (how pip/twine/pypi/venv interact)
  • Builders
  • setuptools
  • flit (3 minutes)
  • poetry (2 minutes)
  • PEP-517/PEP-518 to unify them all
  • What it is, how it does
  • pip support level
  • tox support level
  • Summary/Questions

Bio

I work at Bloomberg, a technology company with more than 5,000 software engineers worldwide -- 2,000 of whom use Python in their daily roles. I'm part of the Python Guild at the company, a group of people dedicated to improving the adoption, usage and best practices of Python at the company. Within the last two years, I've given multiple presentations to various groups (each with around 100 attendees): twice at internal meetups, once at the London Python Meetup, and two conferences in 2018 (PyLondinium and PyCon EU). I've been using Python since 2011, and have been a busy participant in the open source Python community: I am the maintainer of the virtualenv package (tool allowing the creation of Python virtual environments for all Python versions and interpreter types - CPython/Jython/pypy) and the tox tool (allow for easy testing to ensure Python code works under multiple Python version/library versions).