Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,10 @@ pub enum ProjectCommand {
/// When used in a project, the project environment will be created and updated before invoking
/// the command.
///
/// By default, this environment is synced with development dependencies. To prevent development
/// dependencies from being installed (e.g., in a production environment), use the `--no-dev`
/// flag, use the `--no-sync` flag, or set `UV_NO_DEV=1`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think --no-sync is the right thing to suggest here. Also, let's merge this into the above paragraph

///
/// When used outside a project, if a virtual environment can be found in the current directory
/// or a parent directory, the command will be run in that environment. Otherwise, the command
/// will be run in the environment of the discovered interpreter.
Expand Down Expand Up @@ -1186,6 +1190,9 @@ pub enum ProjectCommand {
/// At present, `requirements.txt`, `pylock.toml` (PEP 751) and CycloneDX v1.5 JSON output
/// formats are supported.
///
/// By default, the exported requirements include the project's default dependency groups
/// (such as the standard dependencies and the `dev` group).
///
Comment on lines +1193 to +1195

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?? this seems like an inadvertent change

/// The project is re-locked before exporting unless the `--locked` or `--frozen` flag is
/// provided.
///
Expand Down
8 changes: 8 additions & 0 deletions docs/concepts/projects/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,14 @@ version = "2.6.3"
requires-dist = ["torch", "einops"]
```

## Dynamic metadata

If your project uses dynamic metadata (e.g., to determine the version or dependencies dynamically),
uv may need additional configuration to invalidate its cache when the metadata changes.

See the [caching documentation](../cache.md#dynamic-metadata) for details on configuring cache
invalidation for dynamic metadata.

Comment on lines +545 to +552

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

irrelevant to this PR

## Editable mode

By default, the project will be installed in editable mode, such that changes to the source code are
Expand Down
8 changes: 8 additions & 0 deletions docs/concepts/projects/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ and synced before invoking the requested command. This ensures the project envir
up-to-date. Similarly, commands which read the lockfile, such as `uv tree`, will automatically
update it before running.

!!! tip "Syncing in production environments"

Because `uv run` automatically syncs the environment and includes development dependencies by default,
it may inadvertently install development dependencies when used in production.

To avoid this, use the `--no-dev` flag (e.g., `uv run --no-dev ...`), or `--no-sync` if the environment
is already prepared (e.g., via an earlier `uv sync --no-dev`). You can also enforce this by setting `UV_NO_SYNC=1` or `UV_NO_DEV=1` in your environment.

Comment on lines +14 to +21

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right place to call this out. I'd just remove this part.

To disable automatic locking, use the `--locked` option:

```console
Expand Down
Loading