Mastering the Art of Python Project Setup with Setuptools
Published in
10 min readJan 17, 2024
TL;DR
Once you’ve written a Python application, you might wonder what’s the best way to distribute it. This article covers setuptools
and how it is used to prepare Python packages that can be shipped with pip
and explains further details about project structuring best practices as well as how to include non-Python files into your packages.
Given the topic of setuptools
is huge, I won’t be handling every aspect of it in this post. Nevertheless, I plan to write more posts on the topic in the future.
What is covered in this blog post:
- Setting up your project structure
- Setting up a
setup.py
file - Including non-Python files using
setup.py
- Configuring dependencies using
setup.py
- Locally installing your application
What will be covered in later blog posts:
- Setting up a
pyproject.toml
- Migrating from setup.py to
pyproject.toml
- Configure an entry point for your script
- Advanced versioning with Git
- Publishing your application to Pypi or GitLab Package Registry