mirror of https://github.com/astral-sh/uv
Allow underscores in entrypoints (#9825)
This commit is contained in:
parent
8110dedde7
commit
c0f8e20a51
|
|
@ -40,7 +40,7 @@ pub enum ValidationError {
|
|||
#[error("Entrypoint groups must consist of letters and numbers separated by dots, invalid group: `{0}`")]
|
||||
InvalidGroup(String),
|
||||
#[error(
|
||||
"Entrypoint names must consist of letters, numbers, dots and dashes; invalid name: `{0}`"
|
||||
"Entrypoint names must consist of letters, numbers, dots, underscores and dashes; invalid name: `{0}`"
|
||||
)]
|
||||
InvalidName(String),
|
||||
#[error("Use `project.scripts` instead of `project.entry-points.console_scripts`")]
|
||||
|
|
@ -558,7 +558,7 @@ impl PyProjectToml {
|
|||
// More strict than the spec, we enforce the recommendation
|
||||
if !name
|
||||
.chars()
|
||||
.all(|c| c.is_alphanumeric() || c == '.' || c == '-')
|
||||
.all(|c| c.is_alphanumeric() || c == '.' || c == '-' || c == '_')
|
||||
{
|
||||
return Err(ValidationError::InvalidName(name.to_string()));
|
||||
}
|
||||
|
|
@ -1273,7 +1273,7 @@ mod tests {
|
|||
"a@b" = "bar"
|
||||
"#
|
||||
});
|
||||
assert_snapshot!(script_error(&contents), @"Entrypoint names must consist of letters, numbers, dots and dashes; invalid name: `a@b`");
|
||||
assert_snapshot!(script_error(&contents), @"Entrypoint names must consist of letters, numbers, dots, underscores and dashes; invalid name: `a@b`");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in New Issue