def METHOD_NAME(url):
    # type: (httpx.URL) -> str
    """
    Helper to convert the httpx.URL parts from bytes to a str
    """
    # httpx==0.13.0 added URL.raw, removed in httpx==0.23.1. Otherwise, must construct manually
    if HTTPX_VERSION < (0, 13, 0):
        # Manually construct the same way httpx==0.13 does it:
        # https://github.com/encode/httpx/blob/2c2c6a71a9ff520d237f8283a586df2753f01f5e/httpx/_models.py#L161
        scheme = url.scheme.encode("ascii")
        host = url.host.encode("ascii")
        port = url.port
        raw_path = url.full_path.encode("ascii")
    elif HTTPX_VERSION < (0, 23, 1):
        scheme, host, port, raw_path = url.raw
    else:
        scheme = url.raw_scheme
        host = url.raw_host
        port = url.port
        raw_path = url.raw_path
    url = scheme + b"://" + host
    if port is not None:
        url += b":" + ensure_binary(str(port))
    url += raw_path
    return ensure_text(url)