Add support for optional --description in uv init (#10209)

## Summary
Closes #7913 by adding an optional `--description` argument to `uv init`
that fills the description field in the pyproject.toml with the supplied
arg value.

Updated `uv init` docs to describe this new optional argument.
<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan
Added snapshot tests in `uv/crates/uv/tests/it/init.rs` to test this
functionality.
<!-- How was it tested? -->

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
Arnav Gupta
2024-12-27 19:06:51 -05:00
committed by GitHub
parent 8992f5524c
commit 3733008e6c
6 changed files with 123 additions and 4 deletions

View File

@@ -589,6 +589,8 @@ uv init [OPTIONS] [PATH]
<p>While uv configuration can be included in a <code>pyproject.toml</code> file, it is not allowed in this context.</p>
<p>May also be set with the <code>UV_CONFIG_FILE</code> environment variable.</p>
</dd><dt><code>--description</code> <i>description</i></dt><dd><p>Set the project description</p>
</dd><dt><code>--directory</code> <i>directory</i></dt><dd><p>Change to the given directory prior to running the command.</p>
<p>Relative paths are resolved with the given directory as the base.</p>