๐Ÿ—’๏ธuv: The Fast, All-in-One Python Project Manager
2024-9-18
| 2024-9-18
0 ย |ย  Read Time 0 min
type
status
date
slug
summary
tags
category
icon
password
URL
The Python packaging ecosystem has always been a bit chaotic, but the new tool uv, created by Astral (the team behind Ruff), aims to simplify and speed up the process. Written in Rust, uv is designed to replace tools like pip, venv, and others while offering faster performance. Hereโ€™s how to get started with this promising tool.

Setting Up uv

To install uv, you can simply use pip:
Once installed, you can create a virtual environment with:
If you don't provide a directory, the venv will default to .venv. Note that uv-created environments donโ€™t come with pip or setuptools, as uv encourages using its own tools.

Installing Packages with uv

You can install packages using uvโ€™s own version of pip, like so:
It supports most standard pip commands, including editable installs or optional components:
For installing directly from GitHub, youโ€™ll need a slightly different syntax:
Make sure to include quotes to properly escape the @ symbol.

Managing Dependencies

uv offers useful commands for managing dependencies, such as locking versions and syncing them with your project:
This locks the current versions into a file. To sync dependencies with a locked list, you can use:
And if you want to generate a locked list from pyproject.toml, you can use:
ย 
  • python
  • The Ultimate Guide to pre-commit: Automate Your Code Quality ChecksHow to Solve Docker Permission Denied Issue
    Loading...