Fast Python Development with uv

by Dr. Mike Müller

Friday, 17 April 8:00 - 12:00 incl. breaks · 3.5 hours

uv Dependency Management Environment Management Packages

Description

Learn how to use uv for fast, reliable Python development. Created by Astral (the makers of Ruff), uv is a modern Python package and project manager written in Rust that can replace pip, pip-tools, virtualenv, poetry, pyenv, and more—with dramatic speed improvements.

This hands-on tutorial teaches you how to use uv for managing Python projects, dependencies, and tools. uv is designed to be a drop-in replacement for pip while offering a complete development workflow: project management, dependency resolution, virtual environments, Python version management, and tool installation.

Key advantages of uv:

  • Speed: 10-100x faster than pip for most operations
  • Compatibility: Works with existing pip workflows and requirements.txt files
  • Complete workflow: Replaces multiple tools with a single, unified interface
  • Reliability: Deterministic dependency resolution with lock files

You will learn:

  • How to replace pip with uv for faster package installation
  • How to manage Python projects with pyproject.toml and uv.lock
  • How to handle multiple Python versions without external tools
  • How to manage workspaces for multi-package projects
  • How to use uvx for running Python tools without installation
  • How to run single-file scripts with inline dependencies
  • How to build and publish Python packages
  • Best practices for using uv in real-world projects

A brief comparison with Pixi and other dependency management tools is included.

Please install uv before the tutorial.

Audience

This tutorial is designed for participants who:

  1. Have solid Python knowledge
  2. Are familiar with basic use of pip or similar tools
  3. Want to speed up their development workflow
  4. Would like to learn what uv brings to Python development

Prerequisites:

  • Comfortable writing Python code
  • Basic familiarity with package installation (using pip)
  • Understanding of virtual environments (helpful but not required)
  • Basic command-line usage

No prior experience with uv is required. Familiarity with poetry, conda, or other dependency management tools is helpful but not necessary.

Your trainer: Dr. Mike Müller

Dr. Mike Müller has been teaching Python professionally since 2004 — with over 580 courses and 1,500 teaching days under his belt. A fixture at Python conferences worldwide, he has delivered 75+ tutorials at events including PyCon US (29 tutorials since 2007), EuroPython, and PyData. As a senior trainer at Python Academy, Mike combines deep technical expertise with a hands-on teaching style: live coding from scratch, progressive complexity, and real-world examples that participants can apply immediately.

Details

Format

This tutorial is highly interactive and hands-on:

  • Live Demonstrations (approximately 60%): I develop examples step-by-step, starting from blank notebooks or terminal sessions. Participants are encouraged to type along. The supplied PDF contains all code to help participants get back on track if needed.
  • Exercises (approximately 35%): Three exercise sessions where participants apply concepts to their own projects or work through structured examples. Solutions are reviewed together.
  • Discussion and Q\&A (approximately 5%): Questions are encouraged at any time. I explicitly ask for feedback on pacing and clarity throughout.
Teaching approach:
  • No pre-filled notebooks—everything is built live to show the thought process
  • Typing speed is deliberately moderate to allow participants to follow
  • More complex examples are also provided as Python source code files
  • Comprehensive PDF handout with all content for reference
  • Solutions PDF distributed after the tutorial

Participants will be active throughout the entire tutorial, working with uv on their own machines to build real-world skills.

Outline

Introduction (5 min)
  • Instructor introduction
  • Participant background survey (raise hands to answer questions about Python and dependency management experience)
Problem Analysis (10 min)

Explain what dependency management is needed for.

Two basic tasks:

  • Installing packages
  • Building packages

Questions to set the stage:

  • Why is dependency management complex?
  • What approaches exist?
  • Why is speed important?
Overview of the Ecosystem (15 min)

Look at available tools and explain key terms.

  • Traditional pip-based approaches
    • pip and pip-tools
    • virtualenv and venv
    • pyenv for Python version management
    • poetry
    • pdm
    • hatch/hatchling
    • setuptools
  • conda-based approaches (brief overview)
    • conda/mamba
    • Pixi (hybrid approach with conda-forge + PyPI)
  • Modern unified approach
    • uv: one tool to replace them all
The uv Approach (30 min)
  • Command-line interface (CLI) and pip compatibility
  • pyproject.toml configuration file
  • uv.lock for reproducibility
  • Virtual environments (automatic management)
  • Python version management with uv python
  • Global tool installation with uv tool and uvx
  • Single-file scripts with inline dependencies
  • Exercise (10 min): Getting started with uv
Example - A Small Python Data Project (40 min)
  • Define an example: a small program to analyze data for internal use
  • Start with pandas
  • Add more dependencies progressively:
    • openpyxl for Excel file support
    • matplotlib for visualization
    • pyarrow for Parquet files
  • Use pyproject.toml and uv.lock to manage dependencies
  • Compare installation speed with pip
  • Address potential problems and conflicts
  • Exercise (15 min): Apply uv to your own program
Example - Building a Python Package (40 min)
  • Turn the example into a distributable package
  • Use pyproject.toml for package metadata
  • Use editable installs for development
  • Configure multiple environments for:
    • Testing with pytest
    • Different Python versions
    • Documentation building
  • Workspaces for multi-package projects
  • Building and publishing packages
  • Exercise (15 min): Package your own project
Advanced Features and Best Practices (30 min)
  • Using uvx for running tools without installation
  • Single-file scripts with inline dependency metadata
  • Migrating from pip, poetry, or other tools
  • Working with requirements.txt files
  • Special cases:
    • Handling platform-specific dependencies
    • Integrating with CI/CD pipelines
  • Performance tips and troubleshooting
  • Brief comparison: uv vs. Pixi vs. other tools
Wrap-Up and Q&A (10 min)
  • When to use uv (and when to consider alternatives like Pixi)
  • Migration strategies from other tools
  • Resources for continued learning
  • Open questions and discussion

Internet Requirements (Prep for Tutorial)

Participants will receive detailed setup instructions a few days before the tutorial, including:

  • uv installation instructions for Windows, macOS, and Linux
  • Verification steps to ensure uv is working correctly
  • PDF handout with tutorial content
  • Code examples and exercises
  • Pre-downloading instructions for common packages (optional but recommended)

Critical: Participants MUST have uv installed before the tutorial.

Internet Requirements (During Tutorial)

Internet connection required: This tutorial requires internet connectivity during the session because:

  • Package downloads are a core part of the tutorial (installing packages with uv)
  • Participants will download packages from PyPI
  • Live demonstrations show real-world package installation scenarios
  • Speed comparisons require actual downloads

Bandwidth considerations: To minimize bandwidth usage:

  • Because uv caches packages, participants can reduce bandwidth usage during the tutorial by installing packages a day before the tutorial
  • I will provide instructions how to do this
  • uv's efficient caching means repeated installs use minimal bandwidth

Fallback plan: If internet becomes unavailable:

  • I can still show how my pre-installed environments work
  • The tutorial can pivot to focus on uv configuration and workflow management