Ejemplo n.º 1
0
def get_all_backportable_providers() -> List[str]:
    """
    Returns all providers that should be taken into account when preparing backports.
    For now remove cncf.kubernetes as it has no chances to work with current core of Airflow 2.0
    And Papermill as it is deeply linked with Lineage in Airflow core and it won't work with lineage
    for Airflow 1.10 anyway.
    :return: list of providers that are considered for backport packages
    """
    excluded_providers = ["papermill"]
    return [prov for prov in PROVIDERS_REQUIREMENTS.keys() if prov not in excluded_providers]
Ejemplo n.º 2
0
def get_all_backportable_providers() -> List[str]:
    """
    Returns all providers that should be taken into account when preparing backports.
    For now remove cncf.kubernetes as it has no chances to work with current core of Airflow 2.0
    :return: list of providers that are considered for backport packages
    """
    # TODO: Maybe we should fix it and release cncf.kubernetes separately
    excluded_providers = ["cncf.kubernetes"]
    return [
        prov for prov in PROVIDERS_REQUIREMENTS.keys()
        if prov not in excluded_providers
    ]
Ejemplo n.º 3
0
def update_release_notes_for_packages(package_ids: List[str], release_version: str):
    """
    Updates release notes for the list of packages specified.
    :param package_ids: list of packages
    :param release_version: version to release
    :return:
    """
    import_all_classes(package_ids)
    make_sure_remote_apache_exists()
    if len(package_ids) == 0:
        package_ids = list(PROVIDERS_REQUIREMENTS.keys())
    for package in package_ids:
        update_release_notes_for_package(package, release_version)
def find_provider(provider_elements: List[str]) -> Optional[str]:
    """
    Finds provider name from the list of elements provided. It looks the providers up
    in PROVIDERS_DEPENDENCIES map taken from the provider's package setup.

    :param provider_elements: array of elements of the path (split)
    :return: provider name or None if no provider could be found
    """
    provider = ""
    separator = ""
    provider_keys = PROVIDERS_REQUIREMENTS.keys()
    for element in provider_elements:
        provider = provider + separator + element
        if provider in provider_keys:
            return provider
        separator = "."
    return None
Ejemplo n.º 5
0
        suffix = sys.argv[2]
        sys.argv = [sys.argv[0]] + sys.argv[3:]
    elif "--help" in sys.argv or "-h" in sys.argv or len(sys.argv) < 2:
        usage()
        sys.exit(0)

    if sys.argv[1] not in possible_first_params:
        print(f"""
ERROR! Wrong first param: {sys.argv[1]}
""", file=sys.stderr)
        usage()
        print()
        sys.exit(1)

    if sys.argv[1] == LIST_PROVIDERS_PACKAGES:
        providers = PROVIDERS_REQUIREMENTS.keys()
        for provider in providers:
            print(provider)
        sys.exit(0)
    elif sys.argv[1] == LIST_BACKPORTABLE_PACKAGES:
        providers = get_all_backportable_providers()
        for provider in providers:
            print(provider)
        sys.exit(0)
    elif sys.argv[1] == UPDATE_PACKAGE_RELEASE_NOTES:
        release_ver = ""
        if len(sys.argv) > 2 and re.match(r'\d{4}\.\d{2}\.\d{2}', sys.argv[2]):
            release_ver = sys.argv[2]
            print()
            print()
            print(f"Preparing release version: {release_ver}")