From 4b9caeb2392c77aa0129aab59aa02a76b64565f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Bregu=C5=82a?= Date: Thu, 21 Oct 2021 04:57:00 +0200 Subject: [PATCH] Warn about unsupported Python 3.10 (#19060) Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com> --- README.md | 2 ++ airflow/__init__.py | 3 ++- airflow/__main__.py | 10 +++++++++- docs/apache-airflow/installation/prerequisites.rst | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e2eee87dfde9..29bf96a283726 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,8 @@ MariaDB is not tested/recommended. **Note**: SQLite is used in Airflow tests. Do not use it in production. We recommend using the latest stable version of SQLite for local development. +**Note**: Python v3.10 is not supported yet. For details, see [#19059](https://github.com/apache/airflow/issues/19059). + ## Getting started Visit the official Airflow website documentation (latest **stable** release) for help with diff --git a/airflow/__init__.py b/airflow/__init__.py index a913d141e5fb2..173adc5815376 100644 --- a/airflow/__init__.py +++ b/airflow/__init__.py @@ -36,7 +36,7 @@ __version__ = version.version -__all__ = ['__version__', 'login', 'DAG', 'PY36', 'PY37', 'PY38', 'PY39'] +__all__ = ['__version__', 'login', 'DAG', 'PY36', 'PY37', 'PY38', 'PY39', 'PY310'] # Make `airflow` an namespace package, supporting installing # airflow.providers.* in different locations (i.e. one in site, and one in user @@ -51,6 +51,7 @@ PY37 = sys.version_info >= (3, 7) PY38 = sys.version_info >= (3, 8) PY39 = sys.version_info >= (3, 9) +PY310 = sys.version_info >= (3, 10) def __getattr__(name): diff --git a/airflow/__main__.py b/airflow/__main__.py index ff12453aebec2..50f156a3acf29 100644 --- a/airflow/__main__.py +++ b/airflow/__main__.py @@ -19,13 +19,15 @@ # under the License. """Main executable module""" - import os +import warnings import argcomplete +from airflow import PY310 from airflow.cli import cli_parser from airflow.configuration import conf +from airflow.utils.docs import get_docs_url def main(): @@ -33,6 +35,12 @@ def main(): if conf.get("core", "security") == 'kerberos': os.environ['KRB5CCNAME'] = conf.get('kerberos', 'ccache') os.environ['KRB5_KTNAME'] = conf.get('kerberos', 'keytab') + if PY310: + docs_url = get_docs_url('installation/prerequisites.html') + warnings.warn( + "Python v3.10 is not official supported on this version of Airflow. Please be careful. " + f"For details, see: {docs_url}" + ) parser = cli_parser.get_parser() argcomplete.autocomplete(parser) diff --git a/docs/apache-airflow/installation/prerequisites.rst b/docs/apache-airflow/installation/prerequisites.rst index f72de9ed2fa02..31fe6fc0d8d47 100644 --- a/docs/apache-airflow/installation/prerequisites.rst +++ b/docs/apache-airflow/installation/prerequisites.rst @@ -37,6 +37,8 @@ running multiple schedulers -- please see: :doc:`/concepts/scheduler`. MariaDB i **Note:** SQLite is used in Airflow tests. Do not use it in production. We recommend using the latest stable version of SQLite for local development. +**Note**: Python v3.10 is not supported yet. For details, see `#19059 `__. + Starting with Airflow 2.1.2, Airflow is tested with Python 3.6, 3.7, 3.8, and 3.9. The minimum memory required we recommend Airflow to run with is 4GB, but the actual requirements depends