Packaging¶
packaging
¶
Centralized UV package management.
All Python package installations go through :func:uv_install.
No pip fallback — uv is required (the bootstrap downloads it).
Replaces all raw python -m pip install calls across the codebase.
UvNotFoundError
¶
Bases: RuntimeError
Raised when uv is not available on the system.
find_uv(install_path=None, python_exe=None)
¶
Find the uv executable.
Checks the local scripts/uv/ directory first (where the
bootstrap installs it), then falls back to the system PATH.
When install_path is not provided but python_exe is, the install root is derived from the venv Python path::
{install_path}/scripts/venv/Scripts/python.exe (Windows)
{install_path}/scripts/venv/bin/python (Linux)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
install_path
|
Path | None
|
Root install directory (e.g. |
None
|
python_exe
|
Path | None
|
Path to the venv Python executable. Used to auto-detect install_path when not explicitly given. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
Absolute path to |
Source code in src/utils/packaging.py
uv_install(python_exe, packages=None, *, index_url=None, requirements=None, upgrade=False, no_build_isolation=False, no_deps=False, editable=None, ignore_errors=False, timeout=600, log=None)
¶
Install Python packages via uv pip install.
Builds the full uv pip install command and delegates to
:func:~src.utils.commands.run_and_log.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Path to the target venv Python executable.
Passed as |
required |
packages
|
list[str] | None
|
Package specifiers to install (e.g. |
None
|
index_url
|
str | None
|
PyPI index URL override ( |
None
|
requirements
|
Path | None
|
Path to a |
None
|
upgrade
|
bool
|
If |
False
|
no_build_isolation
|
bool
|
If |
False
|
no_deps
|
bool
|
If |
False
|
editable
|
Path | None
|
Path to install in editable mode ( |
None
|
ignore_errors
|
bool
|
Forwarded to :func: |
False
|
timeout
|
int
|
Command timeout in seconds. |
600
|
Returns:
| Type | Description |
|---|---|
CompletedProcess[str]
|
The completed process result. |
Raises:
| Type | Description |
|---|---|
UvNotFoundError
|
If |
CommandError
|
If the command fails and ignore_errors is False. |