Improve stubsabot logic for finding the first release with a py.typed file (#9600)

This commit is contained in:
Alex Waygood
2023-01-28 18:03:25 +00:00
committed by GitHub
parent 0024dc4f33
commit 9cd20ce095

View File

@@ -173,7 +173,8 @@ async def release_contains_py_typed(release_to_download: PypiReleaseDownload, *,
async def find_first_release_with_py_typed(pypi_info: PypiInfo, *, session: aiohttp.ClientSession) -> PypiReleaseDownload:
release_iter = pypi_info.releases_in_descending_order()
while await release_contains_py_typed(release := next(release_iter), session=session):
first_release_with_py_typed = release
if not release.version.is_prerelease:
first_release_with_py_typed = release
return first_release_with_py_typed