mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-26 20:19:08 +00:00
Avoid writing invalid PEP 723 scripts on tool.uv.sources
(#6706)
## Summary We were writing empty lines between the dependencies and the `tool.uv.sources` table, which led to the `/// script` tag being unclosed and thus not recognized. Closes https://github.com/astral-sh/uv/issues/6700.
This commit is contained in:
parent
a8f4e08d5b
commit
8d466db080
2 changed files with 16 additions and 20 deletions
|
@ -350,13 +350,12 @@ fn serialize_metadata(metadata: &str) -> String {
|
|||
output.push('\n');
|
||||
|
||||
for line in metadata.lines() {
|
||||
if line.is_empty() {
|
||||
output.push('\n');
|
||||
} else {
|
||||
output.push_str("# ");
|
||||
output.push('#');
|
||||
if !line.is_empty() {
|
||||
output.push(' ');
|
||||
output.push_str(line);
|
||||
output.push('\n');
|
||||
}
|
||||
output.push('\n');
|
||||
}
|
||||
|
||||
output.push_str("# ///");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue