def METHOD_NAME(url: str) -> str:
    loc = posixpath.join(
        url, urllib.parse.quote(canonicalize_name(project_name))
    )
    # For maximum compatibility with easy_install, ensure the path
    # ends in a trailing slash.  Although this isn't in the spec
    # (and PyPI can handle it without the slash) some other index
    # implementations might break if they relied on easy_install's
    # behavior.
    if not loc.endswith("/"):
        loc = loc + "/"
    return loc