Skip to content

Commit

Permalink
Rename SKIP_UPRADE_CHECK to SKIP_BREEZE_SELF_UPGRADE_CHECK (apache#35876
Browse files Browse the repository at this point in the history
)

The variable name used for self-upgrade check avoidance in Breeze
was named SKIP_UPGRADE_CHECK but it was quite a bit ambiguous
especially after adding SKIP_IMAGE_UPGRADE_CHECK.

The new name is more explicit, renamed also breeze method running
the check for consistency.
  • Loading branch information
potiuk authored Nov 27, 2023
1 parent d045a0f commit 5767080
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion BREEZE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2804,7 +2804,7 @@ make sure to follow these steps:
* choose ``module`` to run and set it to ``airflow_breeze.breeze`` - this is the entrypoint of breeze
* add parameters you want to run breeze with (for example ``ci-image build`` if you want to debug
how breeze builds the CI image
* set ``SKIP_UPGRADE_CHECK`` environment variable to ``true`` to bypass built-in upgrade check of breeze,
* set ``SKIP_BREEZE_SELF_UPGRADE_CHECK`` environment variable to ``true`` to bypass built-in upgrade check of breeze,
this will bypass the check we run in Breeze to see if there are new requirements to install for it
See example configuration for PyCharm which has run/debug configuration for
Expand Down
8 changes: 4 additions & 4 deletions dev/breeze/src/airflow_breeze/utils/path_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def in_help() -> bool:
return "--help" in sys.argv or "-h" in sys.argv


def skip_upgrade_check():
def skip_breeze_self_upgrade_check():
return (
in_self_upgrade()
or in_autocomplete()
or in_help()
or hasattr(sys, "_called_from_test")
or os.environ.get("SKIP_UPGRADE_CHECK")
or os.environ.get("SKIP_BREEZE_SELF_UPGRADE_CHECK")
)


Expand Down Expand Up @@ -243,7 +243,7 @@ def find_airflow_sources_root_to_operate_on() -> Path:
if sources_root_from_env:
return Path(sources_root_from_env)
installation_airflow_sources = get_installation_airflow_sources()
if installation_airflow_sources is None and not skip_upgrade_check():
if installation_airflow_sources is None and not skip_breeze_self_upgrade_check():
get_console().print(
"\n[error]Breeze should only be installed with -e flag[/]\n\n"
"[warning]Please go to Airflow sources and run[/]\n\n"
Expand All @@ -254,7 +254,7 @@ def find_airflow_sources_root_to_operate_on() -> Path:
)
sys.exit(1)
airflow_sources = get_used_airflow_sources()
if not skip_upgrade_check():
if not skip_breeze_self_upgrade_check():
# only print warning and sleep if not producing complete results
reinstall_if_different_sources(airflow_sources)
reinstall_if_setup_changed()
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/src/airflow_breeze/utils/reinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def reinstall_breeze(breeze_sources: Path, re_run: bool = True):
if re_run:
# Make sure we don't loop forever if the metadata hash hasn't been updated yet (else it is tricky to
# run pre-commit checks via breeze!)
os.environ["SKIP_UPGRADE_CHECK"] = "true"
os.environ["SKIP_BREEZE_SELF_UPGRADE_CHECK"] = "true"
os.execl(sys.executable, sys.executable, *sys.argv)
get_console().print(f"\n[info]Breeze has been reinstalled from {breeze_sources}. Exiting now.[/]\n\n")
sys.exit(0)
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/pre_commit/pre_commit_breeze_cmd_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def is_regeneration_needed() -> bool:
os.environ["AIRFLOW_SOURCES_ROOT"] = str(AIRFLOW_SOURCES_DIR)
# needed to keep consistent output
os.environ["PYTHONPATH"] = str(BREEZE_SOURCES_DIR)
os.environ["SKIP_UPGRADE_CHECK"] = "true"
os.environ["SKIP_BREEZE_SELF_UPGRADE_CHECK"] = "true"
return_code = 0
verify_all_commands_described_in_docs()
if is_regeneration_needed():
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/pre_commit/pre_commit_local_yml_mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pathlib import Path

if __name__ == "__main__":
os.environ["SKIP_UPGRADE_CHECK"] = "true"
os.environ["SKIP_BREEZE_SELF_UPGRADE_CHECK"] = "true"
sys.path.insert(0, str(Path(__file__).parent.resolve())) # make sure common_precommit_utils is imported

from common_precommit_utils import AIRFLOW_SOURCES_ROOT_PATH # isort: skip
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/pre_commit/pre_commit_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
if __name__ == "__main__":
sys.path.insert(0, str(Path(__file__).parent.resolve())) # make sure common_precommit_utils is imported

os.environ["SKIP_UPGRADE_CHECK"] = "true"
os.environ["SKIP_BREEZE_SELF_UPGRADE_CHECK"] = "true"
from common_precommit_utils import filter_out_providers_on_non_main_branch

sys.path.insert(0, str(AIRFLOW_SOURCES / "dev" / "breeze" / "src"))
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/pre_commit/pre_commit_update_er_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
sys.path.insert(0, str(AIRFLOW_SOURCES / "dev" / "breeze" / "src"))
GITHUB_REPOSITORY = os.environ.get("GITHUB_REPOSITORY", "apache/airflow")
os.environ["SKIP_GROUP_OUTPUT"] = "true"
os.environ["SKIP_UPGRADE_CHECK"] = "true"
os.environ["SKIP_BREEZE_SELF_UPGRADE_CHECK"] = "true"
from airflow_breeze.global_constants import DEFAULT_PYTHON_MAJOR_MINOR_VERSION, MOUNT_SELECTED
from airflow_breeze.params.shell_params import ShellParams
from airflow_breeze.utils.console import get_console
Expand Down

0 comments on commit 5767080

Please sign in to comment.