Summary and Schedule
Welcome to Python packaging with pixi course !
This course is designed for intermediate Python user. It covers the basics of Python packaging and how to do that using pixi It is a roughly 2 hour course.
Learning Objectives
- Explain why packaging matters for reproducibility, versioning, and collaboration.
- Structure a Python project following modern best practices.
- Define clear and complete project metadata in pyproject.toml / pixi.toml.
- Manage dependencies and lockfiles using Pixi to ensure consistent environments.
- Build source and wheel distributions of a Python package..
- Publish a package to Test Python Package Index (TestPyPI) using Twine.
- Install a package from TestPyPI using pip.
Prerequisites
- Basic knowledge of Python
- Basic knowledge of GIT
- A GitHub account
- A PyPI or TestPyPI API token
Setup Instructions | Download files required for the lesson | |
Duration: 00h 00m | 1. Why Python Packages? |
Why must we package our Python code? What precisely may be packaged? Why is _init.py file important? What is the Python Package Index (PyPI), and what purpose does it serve? What is a build? |
Duration: 00h 20m | 2. Why choose Pixi for Python Packaging ? |
Why use Pixi? What are the benefits of Pixi ? |
Duration: 00h 25m | 3. Set up a project directory |
How should we structure our project ? What is __init__.py ?How should be name our packages ? |
Duration: 00h 40m | 4. Metadata for Python packging |
What is pyproject.toml ?What is a lockfile, and why is it necessary? |
Duration: 00h 55m | 5. How to publish your Python project |
What is Twine and why is it needed What is build
command and what does it do ?How can we create and upload a Python package? How can we test and use the uploaded Python package? |
Duration: 01h 20m | 6. Extra |
How can we use pixi run start ?
|
Duration: 01h 26m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Software Setup
Details
For this course, we will use GitHub Codespaces, which provides a cloud-based development environment that runs directly in your web browser.
This approach means that no software installation is required on your personal computer, making it much easier to get started.
Your Codespace environment will be Linux-based, so we will be using standard Linux commands and tools throughout the lessons.
Create a repository
Log into GitHub and create a new repository for this lesson called
greet_me
and add a Licence File when creating the repository.From the repository page, open the Code dropdown menu, select the Codespaces tab, and click Create codespace on main.
- Once your Codespace has been created, open the terminal inside it and run the following commands.
Run the following
OUTPUT
This script will automatically download and install Pixi (latest) for you.
Getting it from this url: https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-unknown-linux-musl.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 23.2M 100 23.2M 0 0 24.0M 0 --:--:-- --:--:-- --:--:-- 66.9M
The 'pixi' binary is installed into '/home/codespace/.pixi/bin'
Updating '/home/codespace/.bashrc'
Please restart or source your shell.
If required, restart your shell:
Verify that Pixi has been installed correctly. Please note: the version number displayed may differ from the example below, as newer releases may have been published since this course was written.
OUTPUT
pixi 0.57.0