def generate_filename(
        distribution,
        version,
        build_tag=None,
        python_tag=None,
        abi_tag=None,
        platform_tag=None,
):
    """
    Generate a filename for the wheel and return it.
    """
    if python_tag is None:
        if six.PY3:
            python_tag = "py3"
        else:
            python_tag = "py2"
    if abi_tag is None:
        abi_tag = "none"
    if platform_tag is None:
        platform_tag = "any"
    return "{d}-{v}{b}-{py}-{a}-{p}.whl".format(
        d=escape_filename_component(distribution),
        v=escape_filename_component(version),
        b=("-" + escape_filename_component(build_tag) if build_tag is not None else ""),
        py=escape_filename_component(python_tag),
        a=escape_filename_component(abi_tag),
        p=escape_filename_component(platform_tag),
    )

    Generate a filename for the wheel and return it.
    
lib/stashutils/wheels.py