potiuk commented on code in PR #38742:
URL: https://github.com/apache/airflow/pull/38742#discussion_r1551446250


##########
dev/breeze/src/airflow_breeze/utils/platforms.py:
##########
@@ -16,10 +16,69 @@
 # under the License.
 from __future__ import annotations
 
+import platform
+import sys
+from pathlib import Path
+
 
 def get_real_platform(single_platform: str) -> str:
     """
     Replace different platform variants of the platform provided platforms 
with the two canonical ones we
     are using: amd64 and arm64.
     """
     return single_platform.replace("x86_64", "amd64").replace("aarch64", 
"arm64").replace("/", "-")
+
+
+def _exists_no_permission_error(p: str) -> bool:
+    try:
+        return Path(p).exists()
+    except PermissionError:
+        return False
+
+
+def message_on_wsl1_detected(release_name: str | None, kernel_version: 
tuple[int, ...] | None):
+    from airflow_breeze.utils.console import get_console
+
+    get_console().print("[error]You are running WSL1 - Breeze requires WSL2! 
Quitting.\n")
+    get_console().print("[warning]It can also be that our detection mechanism 
is wrong:[/]\n\n")
+    if release_name:
+        get_console().print(f"[info]We based our WSL1 detection on the release 
name: `{release_name}`\n")
+    elif kernel_version:
+        get_console().print(f"[info]We based our WSL1 detection on the kernel 
version: `{kernel_version}`\n")
+    get_console().print(
+        "[info]If you are running WSL2, please report this issue to the 
maintainers\n"
+        "of Airflow, so we can improve the detection mechanism.\n"
+        "You can also try to run the command with `--uv-http-timeout 900` or "
+        "`--no-use-uv` flag to skip the WSL1 check.\n"
+    )
+
+
+def is_wsl2() -> bool:
+    """
+    Check if the current platform is WSL
+    :return: True if the current platform is WSL
+    """
+    release_name = platform.uname().release

Review Comment:
   Why not :) 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to