Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1471,11 +1471,13 @@ def ui_e2e_tests(
from pathlib import Path

from airflow_breeze.utils.console import get_console
from airflow_breeze.utils.run_utils import run_command
from airflow_breeze.utils.run_utils import check_pnpm_installed, run_command
from airflow_breeze.utils.shared_options import get_dry_run, get_verbose

perform_environment_checks()

check_pnpm_installed()

airflow_root = Path(__file__).resolve().parents[5]
ui_dir = airflow_root / "airflow-core" / "src" / "airflow" / "ui"

Expand Down
36 changes: 36 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/run_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,42 @@ def assert_prek_installed():
sys.exit(1)


def check_pnpm_installed():
Comment thread
potiuk marked this conversation as resolved.
"""
Check if pnpm is installed and install it if npm is available.
"""
if shutil.which("pnpm"):
return

get_console().print("[warning]pnpm is not installed. Installing pnpm...[/]")

# Check if npm is available (required to install pnpm)
if not shutil.which("npm"):
get_console().print("[error]npm is not installed. Please install Node.js and npm first.[/]")
get_console().print("[warning]Visit: https://nodejs.org/[/]")
sys.exit(1)

try:
get_console().print("[info]Installing pnpm using npm...[/]")
result = run_command(
["npm", "install", "-g", "pnpm"],
no_output_dump_on_exception=True,
capture_output=True,
text=True,
check=False,
)
if result.returncode == 0:
get_console().print("[success]pnpm has been installed successfully![/]")
else:
get_console().print(f"[error]Failed to install pnpm: {result.stderr}[/]")
get_console().print("[warning]Please install pnpm manually: https://pnpm.io/installation[/]")
sys.exit(1)
except Exception as e:
get_console().print(f"[error]Failed to install pnpm: {e}[/]")
get_console().print("[warning]Please install pnpm manually: https://pnpm.io/installation[/]")
sys.exit(1)


def get_filesystem_type(filepath: str):
"""
Determine the type of filesystem used - we might want to use different parameters if tmpfs is used.
Expand Down
Loading