Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning about run/import Airflow under the Windows #39196

Merged
merged 1 commit into from
Apr 23, 2024
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
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