Summary and Schedule
This lesson teaches how to share Python code, both in the form of packages, and reproducible scripts. The teaching philosophy is to cover “good enough” practices, with more content linked out when necessary.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Writing Reproducible Python |
What is the difference between the standard library and
third-party packages? How do I share a script so that it runs on someone else’s computer? ::: |
| Duration: 00h 30m | 2. Modules, Packages, and The Search Path |
How does Python know where to find the libraries you import? What distinguishes a python “script” from a python “package”? What is an __init__.py file?::: |
| Duration: 00h 50m | 3. The Project Standard: pyproject.toml |
How do I turn my folder of code into an installable library? What is pyproject.toml and why is it the
standard?How does uv simplify project
management?Why use the src
layout?::: |
| Duration: 01h 20m | 4. Quality Assurance: Testing and Linting |
How do I keep development tools separate from my
library dependencies? How can I automatically fix style errors? How do I ensure my code works as expected? What are pre-commit hooks? ::: |
| Duration: 01h 50m | 5. release_engineering.md |
How do I manage release notes without merge conflicts? How do I publish my package to the world (safely)? ::: |
| Duration: 02h 00m | 6. If It Isn’t Documented, It Doesn’t Exist |
How do I generate professional documentation for my Python
package? What are docstrings, and how do they become web pages? How do I link my documentation to other projects like NumPy? ::: |
| Duration: 02h 40m | 7. The Gatekeeper: Continuous Integration |
What happens if I forget to run the tests before pushing? How do I ensure my code works on Windows, Linux, and macOS? How do I automate uv in the cloud?::: |
| Duration: 03h 10m | 8. Compiled Extensions: The Shared Object Pipeline |
How does the Python ecosystem deliver high-performance binaries
to users? What distinguishes a “Source Distribution” from a “Binary Wheel”? What role does cibuildwheel play in
softwaredistribution? ::: |
| Duration: 04h 00m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Software setup
Details
We basically require pixi and uv. For
conciseness, we reproduce the most direct instructions below.
Technically any Python interpreter suffices, here we use
pixi to handle system dependencies and run tasks, with
uv for managing Python dependencies and environments.
Following along with the pixi instructions
upstream here.
Along with uv from the
official installation documentation.
Following along with the pixi instructions
upstream here.
Along with uv from
the official documentation.
Accounts required
To finalize publishing to an index 1 we need:
- A Git instance in the cloud
- Any of Github, Gitlab, Sourcehut etc. would work, Github is recommended.
- An index account
- For the tutorial Test PyPI will suffice, for production, an account on PyPI would be required as well.
Making the code widely available over the net↩︎