PEP 423 - Names in packaging

Lightning-talk at EuroPython 2013, Florence.

By Benoît Bryon <benoit@marmelune.net>

Presenter Notes

PEP 423 is about naming

  • Public projects, on PyPI
  • Private projects
  • Distributed packages and modules

Presenter Notes

There are issues

Presenter Notes

Clashes

pysendfile and django-sendfile projects

both distribute sendfile package.

Presenter Notes

Inconsistent names

pip install pysandbox VS import sandbox

Presenter Notes

Unrelated namespaces

  • zc.rst2 is not specific to zc project

Presenter Notes

Solutions do exist

Presenter Notes

Use a single name

pip install celery <=> import celery

No hyphens.

Presenter Notes

Follow PEP 8

  • Lowercase
  • Underscores are not recommended

Presenter Notes

Use a single namespace

Except special cases, mostly strong relationships.

Presenter Notes

Use packaging metadata

  • name is identifier on PyPI,
  • keywords, classifiers, ... describe your project,
  • documentation, blog, ... make your project even more visible.

Presenter Notes

Let's do it!

Presenter Notes

New projects SHOULD follow PEP 423

  • Easy to apply
  • Easier project scaffolding
  • Instant benefits

Presenter Notes

Existing projects CAN be renamed

PEP 423 explains how to rename a project.

Deprecate using metadata, do not remove.

Wish list:

  • a tool helps to rename a project
  • PyPI archives inactive and deprecated projects

Presenter Notes

Exceptions SHOULD be documented

  • Easy to do
  • PEP-423 compliant

Presenter Notes

Contributions SHOULD be organized

  • Flask explicitely recommends flask.ext.*
  • Django should clarify django-*

Presenter Notes

PEP 423 is a draft

Presenter Notes

Would you support PEP 423?

  • discussed in 2012 with "owner.project" => no consensus
  • reloading at EuroPython 2013 => what about "single namespace"?

See you in open-space session!

Presenter Notes