This lesson is being piloted (Beta version)

Packaging

When you are programming, usually you are solving a problem - the programming is simply a means to an end. If that’s the case, then packaging is a means to a means to an end. This often makes packaging the last thing you think about, but it’s actually one of the most important parts of any work, as it’s what makes code obtainable and reusable!

Packaging is absolutely critical as soon as you:

Unfortunately, packing has a lot of historical cruft, bad practices that have easy solutions today but are still propagated. This material tries to correct that by showing you a clean, modern way to write and work with Python packages.

See Also

This is a tutorial. For reference material, you should bookmark the following guides:

Prerequisites

  • Basic Python
  • Light familiarity with pytest may be helpful

Schedule

Setup Download files required for the lesson
00:00 1. Environments and task runners How do you install and manage packages?
How can you ensure others run the same code you do?
00:20 2. Python to package How do we take code in a Jupyter Notebook or Python script and turn that into a package?
What are the minimum elements required for a Python package?
How do you set up tests?
00:45 3. Other files that belong with your package What other files are important parts of your software package?
What software license should you use for your project?
01:00 4. Metadata What metadata is important to add to your package?
How to I add common functionality, like executable scripts?
01:15 5. Versioning How do you choose your versions?
How do you set version limits on dependencies?
How do you set a version?
01:30 6. Documentation How do I document my project?
01:50 7. Checks and tests How do you ensure your code will work well?
02:10 8. CI with GitHub Actions How do you ensure code keeps passing
02:30 9. Publishing package and citation How do I publish a package?
How do I make my work citable?
02:45 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.