def interpret_distro_name(
    location, basename, metadata, py_version=None, precedence=SOURCE_DIST, platform=None
):
    """Generate the interpretation of a source distro name

    Note: if `location` is a filesystem filename, you should call
    ``pkg_resources.normalize_path()`` on it before passing it to this
    routine!
    """

    parts = basename.split('-')
    if not py_version and any(re.match(r'py\d\.\d$', p) for p in parts[2:]):
        # it is a bdist_dumb, not an sdist -- bail out
        return

    # find the pivot (p) that splits the name from the version.
    # infer the version as the first item that has a digit.
    for p in range(len(parts)):
        if parts[p][:1].isdigit():
            break
    else:
        p = len(parts)

    yield Distribution(
        location,
        metadata,
        '-'.join(parts[:p]),
        '-'.join(parts[p:]),
        py_version=py_version,
        precedence=precedence,
        platform=platform,
    )
Generate the interpretation of a source distro name

    Note: if `location` is a filesystem filename, you should call
    ``pkg_resources.normalize_path()`` on it before passing it to this
    routine!
    
product/gradle-plugin/src/main/python/setuptools/package_index.py