(marker, supported_versions)
return is_compatible
Determines if any of the given versions are compatible with the given marker
Determines if any of the given versions are compatible with the given marker
Determines if any of the given versions are compatible with the given marker
def is_version_compatible(marker, supported_versions):
    """
    Determines if any of the given versions are compatible with the given marker
    """
    os_markers = ['darwin', 'win32', 'linux', 'aix']
    is_compatible = False

    if marker is None:
        # manually set marker since if there's none the dependency should work on all environments
        marker = Marker('python_version > "2.0"')

    if len(supported_versions) == 0:
        # if there are no classifiers then assume it works on all Python versions
        is_compatible = True

    for python_version in supported_versions:
        has_match = False

        for os in os_markers:
            env = {'python_version': python_version, 'sys_platform': os}
            # override system python version and sys platform to evaluate whether the version is compatible
            has_match = marker.evaluate(environment=env)
            is_compatible = is_compatible or has_match

    return is_compatible
def is_version_compatible ( marker , supported_versions ) : os_markers = [ 'darwin' , 'win32' , 'linux' , 'aix' ] is_compatible = False if marker is None : # manually set marker since if there's none the dependency should work on all environments marker = Marker ( 'python_version > "2.0"' ) if len ( supported_versions ) == 0 : # if there are no classifiers then assume it works on all Python versions is_compatible = True for python_version in supported_versions : has_match = False for os in os_markers : env = { 'python_version' : python_version , 'sys_platform' : os } # override system python version and sys platform to evaluate whether the version is compatible has_match = marker . evaluate ( environment = env ) is_compatible = is_compatible or has_match return is_compatible