import requests


def latest(session: requests.Session, package: str) -> str:
    """Find latest version of package on PyPI.

    Args:
        package: Python package name.

    Returns:
        Latest package version.
    """

    endpoint = f"https://pypi.org/pypi/{package}/json"
    with session.get(endpoint) as resp:
        json = resp.json()

    return f"^{json['info']['version']}"