Migrate from Poetry and pyenv to uv

This commit is contained in:
2026-10-12 15:48:26 +02:00
parent c399a6aed3
commit c69f5f9166
93 changed files with 13068 additions and 2401 deletions
+18 -15
View File
@@ -1,6 +1,6 @@
# Python Development Guidelines
**Document Version:** v11
**Document Version:** v12
> **Note on Versioning:**
> - This document version is independent — reused across projects
@@ -129,28 +129,31 @@ Define specific exception types. Use a fail-fast approach — surface errors ear
Run before every commit:
```bash
poetry run ruff check
poetry run mypy
poetry run pytest
uv run ruff check
uv run mypy
uv run pytest
```
---
## 11. Poetry
## 11. uv
```bash
poetry install # Install all dependencies
poetry add <pkg> # Add runtime dependency
poetry add --group dev <pkg> # Add dev dependency
poetry remove <pkg> # Remove dependency
poetry run <cmd> # Run command in virtualenv
uv sync # Install all dependencies
uv add <pkg> # Add runtime dependency
uv add --dev <pkg> # Add dev dependency
uv remove <pkg> # Remove dependency
uv run <cmd> # Run command in virtualenv
uv python install <version> # Install a uv-managed Python
```
Never edit `pyproject.toml` directly to add or remove dependencies.
### poetry.lock
The interpreter is a uv-managed Python — no pyenv, no system Python.
`poetry.lock` **is committed** for applications — it pins the exact dependency graph and keeps builds reproducible.
### uv.lock
`uv.lock` **is committed** for applications — it pins the exact dependency graph and keeps builds reproducible.
---
@@ -162,7 +165,7 @@ project/
├── src/ # All application modules
├── tests/ # Tests
├── docs/ # Detailed documentation
├── .venv/ # Virtual environment (managed by Poetry)
├── .venv/ # Virtual environment (managed by uv)
└── pyproject.toml # Project config and dependencies
```
@@ -193,8 +196,8 @@ When a project is distributed as a standalone executable (no Python required on
Build commands:
```bash
poetry run python prebuild.py
poetry run pyinstaller ToolName.spec
uv run python prebuild.py
uv run pyinstaller ToolName.spec
```
> This section applies only to projects that produce standalone executables. Skip for libraries or web services.