Packaging your code is an essential skill that empowers you to share your Python projects with the world. However, the packaging process can appear complex and overwhelming, and it can be difficult to know where to begin.
This hands-on tutorial will demystify packaging and get you started with the fundamentals of Python packaging. We’ll cover how to structure projects and follow best practices for project layouts, specify project metadata, make your package installable, and publish it to PyPI. We’ll use the modern and easy-to-use packaging tool uv, but most of the topics covered will also apply to any modern packaging tool (like PDM, Hatch or Poetry).
Every new concept will be introduced as a group, practised individually through practical exercises and then reflected on together as a group. The materials will be available on GitHub, and a compressed packaging cheat sheet will be provided as assistance for the exercises and future reference.
By the end of this tutorial, participants will have created a properly structured Python package, and learned how to manage dependencies effectively with packaging tools such as uv, publish a package to PyPI, and set up basic CI/CD for the project on GitHub.
Audience:
This tutorial assumes you are familiar with basic Python syntax, have some experience creating (smaller or larger) Python programs, and want to learn how to package and share your code. Whether you’re a beginner Pythonista eager to start sharing your code or an experienced developer who wants to be brought up to speed with the current state of packaging, this is the tutorial for you.
Prerequisites:
For this tutorial, you will need a laptop with Python installed.