mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-24 17:54:01 +08:00
Use dashes instead of underscores for METADATA.toml field names (#15614)
This commit is contained in:
@@ -134,11 +134,11 @@ def create_metadata(project: str, stub_dir: Path, version: str) -> None:
|
||||
if upstream_repo_url is None:
|
||||
warning = (
|
||||
f"\nCould not find a URL pointing to the source code for {project!r}.\n"
|
||||
f"Please add it as `upstream_repository` to `stubs/{project}/METADATA.toml`, if possible!\n"
|
||||
f"Please add it as `upstream-repository` to `stubs/{project}/METADATA.toml`, if possible!\n"
|
||||
)
|
||||
print(termcolor.colored(warning, "red"))
|
||||
else:
|
||||
metadata += f'upstream_repository = "{upstream_repo_url}"\n'
|
||||
metadata += f'upstream-repository = "{upstream_repo_url}"\n'
|
||||
print(f"Writing {filename}")
|
||||
filename.write_text(metadata, encoding="UTF-8")
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@ def parse_no_longer_updated_from_archive(source: zipfile.ZipFile | tarfile.TarFi
|
||||
with file as f:
|
||||
toml_data: dict[str, object] = tomllib.load(f)
|
||||
|
||||
no_longer_updated = toml_data.get("no_longer_updated", False)
|
||||
no_longer_updated = toml_data.get("no-longer-updated", False)
|
||||
assert type(no_longer_updated) is bool
|
||||
return bool(no_longer_updated)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user