Skip to content
Permalink
Browse files
Make Breeze help generation indepdent from having breeze installed (#…
…23612)

Generation of Breeze help requires breeze to be installed. However
if you have locally installed breeze with different dependencies
and did not run self-upgrade, the results of generation of the
images might be different (for example when different rich
version is used). This change works in the way that:
* you do not have to have breeze installed at all to make it work
* it always upgrades to latest breeze when it is not installed
* but this only happens when you actually modified some breeze code
  • Loading branch information
potiuk committed May 10, 2022
1 parent 74557e4 commit e36868ba1b8a26f838851d1d09cca9db64cbcdc8
Showing 1 changed file with 3 additions and 6 deletions.
@@ -25,7 +25,8 @@

AIRFLOW_SOURCES_DIR = Path(__file__).parents[3].absolute()
BREEZE_IMAGES_DIR = AIRFLOW_SOURCES_DIR / "images" / "breeze"
BREEZE_SOURCES_DIR = AIRFLOW_SOURCES_DIR / "dev" / "breeze" / "src"
BREEZE_INSTALL_DIR = AIRFLOW_SOURCES_DIR / "dev" / "breeze"
BREEZE_SOURCES_DIR = BREEZE_INSTALL_DIR / "src"

SCREENSHOT_WIDTH = "120"

@@ -66,11 +67,7 @@ def print_help_for_all_commands():
if old_hash == new_hash:
console.print(f"[bright_blue]Skip generation of SVG images as command hash is unchanged {old_hash}")
return
if run(["breeze", "--help"], check=False).returncode != 0:
console.print("[red]ERROR! You need to install breeze with pipx to run this pre-commit[/]")
console.print("\n[bright_blue]Run this command:[/]\n")
console.print(" pip install -e ./dev/breeze --force\n")
sys.exit(1)
run([sys.executable, "-m", "pip", "install", "--upgrade", "-e", BREEZE_INSTALL_DIR])
env = os.environ.copy()
env['AIRFLOW_SOURCES_ROOT'] = str(AIRFLOW_SOURCES_DIR)
env['RECORD_BREEZE_WIDTH'] = SCREENSHOT_WIDTH

0 comments on commit e36868b

Please sign in to comment.