Skip to Content
View all events

Lightning-Speed Python Projects with uv

Published by O'Reilly Media, Inc.

Manage and share projects faster and more easily than ever before

What you’ll learn and how you can apply it

  • Create and manage projects with uv
  • Understand issues with package conflicts and how uv solves them
  • Use uv to manage Python versions across projects
  • Learn how to create shell aliases with uv’s “tools”
  • Publish packages to PyPI using uv

Course description

Unlike so many other aspects of Python, the packaging process often confuses and frustrates programmers. The Python community has traditionally met those challenges with overlapping utilities, libraries, and conventions. But now you have the open source “uv” utility, an all-in-one Python packaging “super app” developed by tool company Astral. It manages your projects, handles Python versioning, and ensures that each project has its own siloed set of package versions. If you’re struggling to manage pip, venv, pyenv, and Poetry (among other tools) and would welcome a better way, this course is for you.

Join author, trainer, and Python expert Reuven Lerner to learn how to use uv to create projects, handle dependencies within your project, handle cross-platform issues, and even publish your work to PyPI.

This live event is for you because...

  • You’re a Python developer.
  • You work on multiple applications.
  • You collaborate with other people.
  • You want to use packages from PyPI, and perhaps even contribute to it.
  • You want to stop juggling multiple tools to manage your project’s dependencies.

Prerequisites

  • uv installed on your computer
  • A PyPI account
  • A Python IDE (e.g., PyCharm or VS Code)
  • General Python programming experience
  • Familiarity with writing simple modules and packages

Schedule

The time frames are only estimates and may vary according to how the class is progressing.

Introducing uv (25 minutes)

  • Presentation: uv instead of pip (i.e., uv pip, uv pip install); what it replaces; using uv in a Python project; uv as an umbrella command; creating a project; files in a Python project; uv is Git-ready
  • Hands-on exercise: Create a Python project
  • Q&A

Running programs (35 minutes)

  • Presentation: Using “uv run”; setting a Python version (i.e., replacing pyenv); pinning a Python version; internal dependencies (PEP 723)
  • Hands-on exercise: Write and run a program
  • Q&A
  • Break

venvs and dependencies (25 minutes)

  • Presentation: Why do we need venvs?; how uv hides venvs; adding dependencies; specifying versions
  • Hands-on exercise: Extend your program with dependencies
  • Q&A

pyproject.toml and uv.lock (35 minutes)

  • Presentation: The role of each file; how to update them; uv sync and uv sync --frozen; issues with traditional package management; package versioning and conflicts
  • Hands-on exercise: Update and examine your Python project
  • Q&A
  • Break

Development dependencies (25 minutes)

  • Presentation: What are development dependencies?; specifying them in pyproject.toml; adding them with uv add
  • Hands-on exercise: Add and use a development dependency
  • Q&A

Tools (35 minutes)

  • Presentation: Global commands; uv tool; where are tools really stored?; uvx
  • Hands-on exercise: install tools for black and ruff
  • Q&A
  • Break

Wheelfiles (30 minutes)

  • Presentation: What’s a wheelfile?; creating wheelfiles; setting and bumping versions
  • Hands-on exercise: Create a Python wheelfile from your project
  • Q&A

Publishing to (test) PyPI (30 minutes)

  • Presentation: Registering; things to consider; updating your files; getting help
  • Hands-on exercise: Publish to PyPI’s test server
  • Q&A

Your Instructor

  • Reuven M. Lerner

    Reuven M. Lerner is a full-time trainer, offering more than 30 courses in Python and data science to companies around the world. He’s the author of Python Workout and Pandas Workout (Manning). His current project, AI-Assisted Python for Nonprogrammers, is available in early release on the O’Reilly platform. He also publishes two newsletters, Better Developers and Bamboo Weekly, and is a popular lecturer at conferences, having presented at both PyCon US and Euro Python for many years. Reuven has a bachelor’s degree in computer science and engineering from MIT, and a PhD in learning sciences from Northwestern University. He lives in Modi’in, Israel, with his wife and three children.

    linkedinXlinksearch

Skill covered

Python