mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Fill in authors
filed during uv init
(#7756)
## Summary Fill in the `authors` field of `pyproject.toml` by fetching author info from Git. Resolves #7718
This commit is contained in:
parent
56521937b7
commit
15e5e3f6af
6 changed files with 288 additions and 11 deletions
|
@ -2346,6 +2346,17 @@ impl ExternalCommand {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Copy, Clone, clap::ValueEnum)]
|
||||
pub enum AuthorFrom {
|
||||
/// Fetch the author information from some sources (e.g., Git) automatically.
|
||||
#[default]
|
||||
Auto,
|
||||
/// Fetch the author information from Git configuration only.
|
||||
Git,
|
||||
/// Do not infer the author information.
|
||||
None,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
#[allow(clippy::struct_excessive_bools)]
|
||||
pub struct InitArgs {
|
||||
|
@ -2432,6 +2443,14 @@ pub struct InitArgs {
|
|||
#[arg(long)]
|
||||
pub no_readme: bool,
|
||||
|
||||
/// Fill in the `authors` field in the `pyproject.toml`.
|
||||
///
|
||||
/// By default, uv will attempt to infer the author information from some sources (e.g., Git) (`auto`).
|
||||
/// Use `--author-from git` to only infer from Git configuration.
|
||||
/// Use `--author-from none` to avoid inferring the author information.
|
||||
#[arg(long, value_enum)]
|
||||
pub author_from: Option<AuthorFrom>,
|
||||
|
||||
/// Do not create a `.python-version` file for the project.
|
||||
///
|
||||
/// By default, uv will create a `.python-version` file containing the minor version of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue