Skip to content

stubsabot: find_first_release_with_py_typed() doesn't work when only the latest release has py.typed #9759

@Akuli

Description

@Akuli

async def find_first_release_with_py_typed(pypi_info: PypiInfo, *, session: aiohttp.ClientSession) -> PypiReleaseDownload | None:
release_iter = pypi_info.releases_in_descending_order()
# If the latest release is not py.typed, assume none are.
if not (await release_contains_py_typed(release := next(release_iter), session=session)):
return None
first_release_with_py_typed: PypiReleaseDownload | None = None
while await release_contains_py_typed(release := next(release_iter), session=session):

This function returns None if the latest release has py.typed and other releases don't. This is because the first next(release_iter) consumes the first release and essentially hides it from the rest of this function.

Broken in #9754

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions