- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Core Tech
Guided: uv Development Workflows
In this Code Lab, you learn how to use uv, a modern and extremely fast tool for managing Python projects. You will create virtual environments, handle dependencies, run development tasks, and build a distributable package for a simple command-line application.
Lab Info
Table of Contents
-
Challenge
Step 1: Getting Started
Welcome to this Code Lab on managing Python projects with
uv!uvis a modern, extremely fast Python package installer and resolver, written in Rust.It's designed to be a drop-in replacement for tools like
pip,pip-tools, andvenv. This lab is designed to work offline, so all required packages are pre-downloaded in thepackagesdirectory.The lab environment is configured to use this local package directory automatically, so you can use
uv synccommands without any additional flags. In this first step, you'll set up the basic configuration file for your project. info > This lab experience was developed by the Pluralsight team using Forge, an internally developed AI tool utilizing Gemini technology. All sections were verified by human experts for accuracy prior to publication. For issue reporting, please contact us. -
Challenge
Step 2: Managing Environments and Dependencies
A key part of any Python project is managing its dependencies in an isolated environment. Here, you'll see how
uvsimplifies this process, from creating a virtual environment to adding the packages your application needs to run. -
Challenge
Step 3: Implementing Application Logic
With the environment set up, it's time to build your application. You'll write the core logic for the CLI tool and define an entry point so it can be run from the command line.
-
Challenge
Step 4: Running Development Tasks
Professional development workflows involve more than just writing code. You also need tools for linting, formatting, and testing. In this step, you'll learn how to manage these development-only dependencies and run them easily using
uv run. -
Challenge
Step 5: Testing the Application
Ensuring your code works as expected is crucial. Here, you'll write a unit test using
pytestto validate your application's logic and then use theuv runtask you created to execute the test suite. -
Challenge
Step 6: Building a Distributable Package
The final step is to package your application for distribution. You'll configure the project's build system and then use
uvto create a standard Python wheel (.whl) file, ready to be shared and installed elsewhere. Congratulations! You have successfully built a distributable Python package usinguv.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.