-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 `[email protected]` | |
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 | ||
<Response [200]> | ||
``` | ||
|
||
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. | ||
|