Summary
In this chapter, we looked at how to package and distribute Python projects through PyPI. We started with some theory about packaging and introduced the concepts of projects, releases, and distributions on PyPI.
We learned about Setuptools, the most widely used packaging library for Python, and worked through the process of preparing a project for packaging with Setuptools. In the process, we saw various files that need to be added to a project to package it and what each of them is for.
We discussed the metadata that you should provide to describe your project and help users find it on PyPI, as well as how to add code to the distribution, how to specify our dependencies, and how to define entry points so that pip
will automatically generate scripts for us. We also looked at the tools that Python provides for accessing the distribution metadata.
We moved on to talking about how to build distribution packages and how to use twine
to upload those packages to PyPI...