uv/docs/reference
Charlie Marsh 792dc9d1c5
Add uv sync --script (#11361)
## Summary

The environment is located at a stable path within the cache, based on
the script's absolute path.

If a lockfile exists for the script, then we use our standard lockfile
semantics (i.e., update the lockfile if necessary, etc.); if not, we
just do a `uv pip sync` (roughly).

Example usage:

```
❯ uv init --script hello.py
Initialized script at `hello.py`

❯ uv add --script hello.py requests
Updated `hello.py`

❯ cargo run sync --script hello.py
Using script environment at: /Users/crmarsh/.cache/uv/environments-v1/hello-84e289fe3f6241a0
Resolved 5 packages in 3ms
Installed 5 packages in 12ms
 + certifi==2025.1.31
 + charset-normalizer==3.4.1
 + idna==3.10
 + requests==2.32.3
 + urllib3==2.3.0
```

Closes https://github.com/astral-sh/uv/issues/6637.
2025-02-12 16:02:16 +00:00
..
policies Add policies reference section and license document (#9367) 2024-12-03 10:56:32 -06:00
troubleshooting Add best-practice flags to pip install example in troubleshooting guide (#11194) 2025-02-03 20:13:55 +00:00
benchmarks.md Add link to benchmarks in documentation (#6257) 2024-08-20 12:54:46 -04:00
cli.md Add uv sync --script (#11361) 2025-02-12 16:02:16 +00:00
index.md Add policies reference section and license document (#9367) 2024-12-03 10:56:32 -06:00
resolver-internals.md Update resolver internals docs (#11098) 2025-02-04 13:06:27 +00:00
settings.md Fix typo in no-deps docs/comments/cli description (#11073) 2025-01-29 11:55:40 -06:00