Skip to content

Commit

Permalink
Add warning about run/import Airflow under the Windows (#39196)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taragolis authored Apr 23, 2024
1 parent 7bb1d4a commit b82c428
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions airflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import os
import sys
import warnings

if os.environ.get("_AIRFLOW_PATCH_GEVENT"):
# If you are using gevents and start airflow webserver, you might want to run gevent monkeypatching
Expand All @@ -30,6 +31,17 @@

patch_all()

if sys.platform == "win32":
warnings.warn(
"Airflow currently can be run on POSIX-compliant Operating Systems. For development, "
"it is regularly tested on fairly modern Linux Distros and recent versions of macOS. "
"On Windows you can run it via WSL2 (Windows Subsystem for Linux 2) or via Linux Containers. "
"The work to add Windows support is tracked via https://github.com/apache/airflow/issues/10388, "
"but it is not a high priority.",
category=RuntimeWarning,
stacklevel=1,
)

# The configuration module initializes and validates the conf object as a side effect the first
# time it is imported. If it is not imported before importing the settings module, the conf
# object will then be initted/validated as a side effect of it being imported in settings,
Expand Down Expand Up @@ -76,8 +88,6 @@ def __getattr__(name: str):
module_path, attr_name, deprecated = __lazy_imports.get(name, ("", "", False))
if not module_path:
if name.startswith("PY3") and (py_minor := name[3:]) in ("6", "7", "8", "9", "10", "11", "12"):
import warnings

warnings.warn(
f"Python version constraint {name!r} is deprecated and will be removed in the future. "
f"Please get version info from the 'sys.version_info'.",
Expand All @@ -88,8 +98,6 @@ def __getattr__(name: str):

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
elif deprecated:
import warnings

warnings.warn(
f"Import {name!r} directly from the airflow module is deprecated and "
f"will be removed in the future. Please import it from 'airflow{module_path}.{attr_name}'.",
Expand Down

0 comments on commit b82c428

Please sign in to comment.