Summary and Schedule
This is a Byte-Sized RSE lesson on software packaging with
uv, part of the Byte-Sized
RSE Series.
Learning Objectives
At the end of this lesson, learners should be able to:
- Explain what software packaging is and why it is important for software reuse, reproducibility and sustainability.
- Describe the key components of a Python package and the role of package metadata, dependencies and documentation.
- Explain how package managers help manage dependencies and create reproducible software environments.
- Describe the difference between source distributions (sdists) and wheels.
- Use
uvtool to prepare an installable Python package.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Introduction |
What is software packaging and why should researchers care about
it? How does packaging make software easier to share, install and maintain? What information is typically included in a software package? How are software dependencies managed in modern Python projects? What is uv and how does it fit into the
modern Python packaging ecosystem?What is pyproject.toml and why has it become the standard project
configuration file?What is the difference between a source distribution and a wheel? How are Python packages published and distributed? |
| Duration: 00h 30m | 2. Example Code |
How to install dependencies and set up virtual environment for a Python
project using pip and venv
|
| Duration: 00h 40m | 3. Software packaging with uv |
How do I package a Python project with uv?What project files does uv create/maintain and what are they used
for?What is pyproject.toml and why has it become the
standard project configuration file?How does uv manage
dependencies and virtual environments?What is a lock file and why is it important for reproducible software? How do I add, remove and update project dependencies? How can I run Python scripts using uv?How do I build a source distribution and a wheel using uv?How can I migrate an existing project from pip and venv to uv?
|
| Duration: 01h 40m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Setup
- Shell with Git version control tool installed and set up
- Ability to navigate filesystem and run commands from within a shell
- Ability to use basic Git commands from a shell
- Python version 3.8 or above installed (with
pipandvenvtools) - Understanding of Python syntax to be able to read and follow code examples
- Understanding of managing Python dependencies and virtual
environments (e.g. using
pipandvenvtools) -
uvPython package and dependency management tool installed - GitHub account
- Example code copied into your GitHub account
Shell with Git
On macOS and Linux, some version of a shell (e.g. bash)
with Git will be available by default and no installation is needed.
If you do not have a bash shell installed on your system and require assistance with the installation, you can take a look at the instructions provided by Software Carpentry for installing shell and Git.
Python
Python version 3.8 or above is required. Type python -v
at your shell prompt and press enter to see what version of Python is
installed on your system. If you do not have Python installed on your
system and require assistance with the installation, you can take a look
at the
instructions provided by Software Carpentry for installing Python in
preparation for undertaking their Python lesson.
uv
You must install the Python package and dependency management tool
uv (version 0.12 or higher) to follow along with the
hands-on part of this lesson. uv can be obtained from Astral.
You can check your version of uv with the
uv self version command and update it, if needed, with
uv self update.
Code Editor
For the hands-on part of this topic you will need a code editor to navigate and edit software project files. You can use, for example Visual Studio Code (VS Code) - a widely used IDE, or any other IDE or code editor of your choice.
GitHub
We use GitHub to store code examples you will have to copy. If you do not already have a GitHub account - you can open one for free.
Example Code
Example
code we will use for the session can be obtained from GitHub. Please
make sure to copy this repository into your GitHub account by using the
Use this template button on GitHub.
After creating your copy of the example code repository, using Git from a shell make a clone on your machine: