uv
- An extremely fast Python package and project manager, written in Rust
- uses
pyproject.toml
(anduv.lock
) - follows the
src/
directory layout - example production optimized
Dockerfile
- github actions ci
- depends on: httpx, granian and polars, just as an example
uv sync
uv run granian --interface asginl demo.web:app
uv run pyright
uv run ruff format
uv run ruff check
podman build -t uv-demo .
podman run -it --rm -p 8000:8000 uv-demo
Note
Use Podman or Docker - it's the same, podman is rootless on Linux
These scripts will be executed in the context (venv, python) of the project, good for development helper scripts:
uv run scripts/h.py
uv run scripts/p.py
uv run scripts/example.py 1 2 3 hello world 4 5
uv
can also run scripts that have the pep-0723 based metadata,
like dependencies. There's no need to setup venvs or dependencies
in a pyproject.toml file, uv automagically creats an ad-hoc venv
for the script.
See:
uv run scripts/pep723.py