Summary and Setup

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 code is beneficial for collaboration and reproducibility.
  • Structure a Python project in a standard, recognizable way.
  • Define project metadata required for packaging.
  • Build a distributable package from source files.
  • Install a package locally for testing and development.
  • Write and run a simple unit test for the package’s functionality.
  • Upload a package to the Test Python Package Index (TestPyPI).
  • Install a package from TestPyPI using pip.
Prerequisite

Prerequisites

  • Basic knowledge of Python
  • Basic knowledge of GIT
  • A GitHub account

Software Setup


Discussion

Details

For this course, we will use GitHub Codespaces, providing a cloud-based development environment that runs directly in your web browser. This setup means no local software installation is required on your personal computer, simplifying our getting-started process. Your Codespace environment is Linux-based, so we will be using standard Linux commands and tools throughout

1. Create a repository


  • Log into GitHub and create a new repository for this lesson called greet_me.

  • From the top right, under the Code drop down, choose the Codepaces tab and click on the button : Create codespace on main.

image
  • Open the terminal inside the codepaces created for you and try the command below.

To install pixi, run:

BASH

curl -fsSL https://pixi.sh/install.sh | sh

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.

To restart the shell, use this command, if needed.

BASH

source ~/.bashrc

Check if pixi is installed correctly

BASH

pixi --version

OUTPUT

pixi 0.53.0