mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Fix str2bool failure on stubsabot dry-run (#12287)
This commit is contained in:
@@ -230,11 +230,16 @@ async def release_contains_py_typed(release_to_download: PypiReleaseDownload, *,
|
||||
with zipfile.ZipFile(body) as zf:
|
||||
return all_py_files_in_source_are_in_py_typed_dirs(zf)
|
||||
elif packagetype == "sdist":
|
||||
assert release_to_download.filename.endswith(
|
||||
".tar.gz"
|
||||
), f"Package file {release_to_download.filename!r} does not end with '.tar.gz'"
|
||||
with tarfile.open(fileobj=body, mode="r:gz") as zf:
|
||||
return all_py_files_in_source_are_in_py_typed_dirs(zf)
|
||||
# sdist defaults to `.tar.gz` on Lunix and to `.zip` on Windows:
|
||||
# https://docs.python.org/3.11/distutils/sourcedist.html
|
||||
if release_to_download.filename.endswith(".tar.gz"):
|
||||
with tarfile.open(fileobj=body, mode="r:gz") as zf:
|
||||
return all_py_files_in_source_are_in_py_typed_dirs(zf)
|
||||
elif release_to_download.filename.endswith(".zip"):
|
||||
with zipfile.ZipFile(body) as zf:
|
||||
return all_py_files_in_source_are_in_py_typed_dirs(zf)
|
||||
else:
|
||||
raise AssertionError(f"Package file {release_to_download.filename!r} does not end with '.tar.gz' or '.zip'")
|
||||
else:
|
||||
raise AssertionError(f"Unknown package type for {release_to_download.distribution}: {packagetype!r}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user