uv
An ultra-fast Python project manager that simplifies working with dependencies and tools without unnecessary steps.
What is it used for here?
!
- Installs all current project dependencies and features (main and dev) after cloning (project initialization)
- Automatically creates an isolated environment (similar to venv, but without manual steps)
- Allows running any Python tools (e.g., pytest, ruff, mypy) without activating venv or extra configuration
- Ensures a consistent environment for local development, CI/CD, and devcontainer
How it works in this template
-
After cloning the project, just run:
This command:- Installs all dependencies via uv
- Sets up pre-commit hooks
-
To run Python tools (tests, linters, etc.), you needn't activate venv:
-
To add a new dependency:
or for dev dependencies:
How to update or change the Python version for the project
!
-
Edit the Python version in pyproject.toml, for example:
-
Remove the old environment (optional):
-
Change the Python version in your
.python-version
file:- You can specify any interpreter available on your system (
python3.12
,python3.10
, etc.). - If the specified Python version is not installed, uv will automatically install it.
- If you don't specify a version, uv uses the current Python version installed on your system.
- You can specify any interpreter available on your system (
-
Reinstall dependencies:
-
The project now uses the desired Python version in its venv.
Configuration
- All configuration for uv in this template is located in pyproject.toml (file is generated automatically by uv).
For more details on configuration, see the uv Documentation