diff --git a/README.md b/README.md index 7f948c12627d..8aa256df81a8 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ An extremely fast Python package and project manager, written in Rust. - ⚡️ [10-100x faster](https://github.com/astral-sh/uv/blob/main/BENCHMARKS.md) than `pip`. - 🐍 [Installs and manages](#python-management) Python versions. - 🛠️ [Runs and installs](#tool-management) Python applications. -- ❇️ [Runs single-file scripts](https://docs.astral.sh/uv/guides/scripts), with support for +- ❇️ [Runs single-file scripts](#script-support), with support for [inline dependency metadata](https://docs.astral.sh/uv/guides/scripts#declaring-script-dependencies). - 🗂️ Provides [comprehensive project management](#project-management), with a [universal lockfile](https://docs.astral.sh/uv/concepts/projects#lockfile). @@ -175,6 +175,30 @@ Pinned `.python-version` to `pypy@3.11` See the [Python installation documentation](https://docs.astral.sh/uv/guides/install-python/) to get started. +### Script support + +uv manages dependencies and environments for single-file scripts. + +Create a new script and add inline metadata declaring its dependencies: + +```console +$ echo 'import requests; print(requests.get("https://astral.sh"))' > example.py + +$ uv add --script example.py requests +Updated `example.py` +``` + +Then, run the script in an isolated virtual environment: + +``` +$ uv run example.py +Reading inline script metadata from: example.py +Installed 5 packages in 12ms + +``` + +See the [scripts documentation](https://docs.astral.sh/uv/guides/scripts/) to get started. + ### A pip-compatible interface uv provides a drop-in replacement for common `pip`, `pip-tools`, and `virtualenv` commands.