Skip to content
Merged
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
20 changes: 20 additions & 0 deletions dev/breeze/src/airflow_breeze/commands/developer_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from __future__ import annotations

import os
import platform
import re
import shlex
import shutil
Expand Down Expand Up @@ -129,6 +130,18 @@
CELERY_INTEGRATION = "celery"


def is_wsl() -> bool:
"""Detect if we are running inside WSL."""
if platform.system().lower() != "linux":
return False
try:
with open("/proc/version") as f:
version_info = f.read().lower()
return "microsoft" in version_info or "wsl" in version_info
except FileNotFoundError:
return False


def _determine_constraint_branch_used(airflow_constraints_reference: str, use_airflow_version: str | None):
"""
Determine which constraints reference to use.
Expand Down Expand Up @@ -611,6 +624,13 @@ def start_airflow(
)
skip_assets_compilation = True

# Automatically enable file polling for hot reloading under WSL
if dev_mode and is_wsl():
os.environ["CHOKIDAR_USEPOLLING"] = "true"
get_console().print(
"[info]Detected WSL environment. Automatically enabled CHOKIDAR_USEPOLLING for hot reloading."
)

if use_airflow_version is None and not skip_assets_compilation:
# Now with the /ui project, lets only do a static build of /www and focus on the /ui
run_compile_ui_assets(dev=dev_mode, run_in_background=True, force_clean=False)
Expand Down
Loading