예제 #1
0
def get_used_airflow_sources() -> Path:
    """
    Retrieves the Root of used Airflow Sources which we operate on. Those are either Airflow sources found
    upwards in directory tree or sources where Breeze was installed from.
    :return: the Path for Airflow sources we use.
    """
    current_sources = search_upwards_for_airflow_sources_root(Path.cwd())
    if current_sources is None:
        current_sources = get_installation_airflow_sources()
        if current_sources is None:
            warn_non_editable()
            sys.exit(1)
    return current_sources
예제 #2
0
def self_upgrade(force: bool, use_current_airflow_sources: bool):
    if use_current_airflow_sources:
        airflow_sources = get_used_airflow_sources()
    else:
        airflow_sources = get_installation_airflow_sources()
    if airflow_sources is not None:
        breeze_sources = airflow_sources / "dev" / "breeze"
        if force:
            reinstall_breeze(breeze_sources)
        else:
            ask_to_reinstall_breeze(breeze_sources)
    else:
        warn_non_editable()
        sys.exit(1)