(source, name, base_versions, force_pinned=True, min_base_version=None)
return not failed
Minimal dependency verification for `datadog-checks-base` dependencies.

    Ensures that the version isn't specifically pinned since that will limit check installations.
    Optionally ensures that dependencies which have no pins are reported as errors.
    Optionally validate a specific version satisfies the base requirement spec.
Minimal dependency verification for `datadog-checks-base` dependencies.
Minimal dependency verification for datadog - checks - base dependencies .
def verify_base_dependency(source, name, base_versions, force_pinned=True, min_base_version=None):
    """Minimal dependency verification for `datadog-checks-base` dependencies.

    Ensures that the version isn't specifically pinned since that will limit check installations.
    Optionally ensures that dependencies which have no pins are reported as errors.
    Optionally validate a specific version satisfies the base requirement spec.
    """
    failed = False
    for specifier_set, dependency_definitions in base_versions.items():
        checks = sorted(dep.check_name for dep in dependency_definitions)
        file = os.path.join(get_root(), format_check_usage(checks, source), 'setup.py')
        if not specifier_set and force_pinned:
            message = f'Unspecified version found for dependency `{name}`: {format_check_usage(checks, source)}'
            echo_failure(message)
            annotate_error(file, message)
            failed = True
        elif len(specifier_set) > 1:
            message = (
                f'Multiple unstable version pins `{specifier_set}` found for dependency `{name}`: '
                f'{format_check_usage(checks, source)}'
            )
            echo_failure(message)
            annotate_error(file, message)
            failed = True
        elif specifier_set:
            specifier = get_next(specifier_set)

            if specifier.operator != '>=':
                message = (
                    f'Forced version pin `{specifier}` found for dependency `{name}` '
                    f'(use >= explicitly for base dependency): {format_check_usage(checks, source)}'
                )
                echo_failure(message)
                annotate_error(file, message)
                failed = True

            if min_base_version is not None and min_base_version not in specifier:
                message = (
                    f'Minimum datadog_checks_base version `{min_base_version}` not satisfied by dependency specifier'
                    f'`{specifier}`: {format_check_usage(checks, source)}'
                )
                echo_failure(message)
                annotate_error(file, message)
                failed = True

    return not failed
def verify_base_dependency ( source , name , base_versions , force_pinned = True , min_base_version = None ) : failed = False for specifier_set , dependency_definitions in base_versions . items ( ) : checks = sorted ( dep . check_name for dep in dependency_definitions ) file = os . path . join ( get_root ( ) , format_check_usage ( checks , source ) , 'setup.py' ) if not specifier_set and force_pinned : message = f'Unspecified version found for dependency `{name}`: {format_check_usage(checks, source)}' echo_failure ( message ) annotate_error ( file , message ) failed = True elif len ( specifier_set ) > 1 : message = ( f'Multiple unstable version pins `{specifier_set}` found for dependency `{name}`: ' f'{format_check_usage(checks, source)}' ) echo_failure ( message ) annotate_error ( file , message ) failed = True elif specifier_set : specifier = get_next ( specifier_set ) if specifier . operator != '>=' : message = ( f'Forced version pin `{specifier}` found for dependency `{name}` ' f'(use >= explicitly for base dependency): {format_check_usage(checks, source)}' ) echo_failure ( message ) annotate_error ( file , message ) failed = True if min_base_version is not None and min_base_version not in specifier : message = ( f'Minimum datadog_checks_base version `{min_base_version}` not satisfied by dependency specifier' f'`{specifier}`: {format_check_usage(checks, source)}' ) echo_failure ( message ) annotate_error ( file , message ) failed = True return not failed