Skip to content

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

Description

@Akuli

asyncdeffind_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.
ifnot (awaitrelease_contains_py_typed(release:=next(release_iter), session=session)):
returnNone
first_release_with_py_typed: PypiReleaseDownload|None=None
whileawaitrelease_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