This is an automated email from the ASF dual-hosted git repository.

jedcunningham pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 06438096e2d6bc2036deab045d3b54ff1846d1f9
Author: Kamil BreguĊ‚a <mik-...@users.noreply.github.com>
AuthorDate: Thu Oct 21 04:57:00 2021 +0200

    Warn about unsupported Python 3.10 (#19060)
    
    Co-authored-by: Jed Cunningham 
<66968678+jedcunning...@users.noreply.github.com>
    (cherry picked from commit c14aed3acbaa9699331722ffc6ae458f9b31ba6e)
---
 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 71bf8dc..b94a982 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 a913d14..173adc5 100644
--- a/airflow/__init__.py
+++ b/airflow/__init__.py
@@ -36,7 +36,7 @@ from airflow import version
 
 __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 @@ PY36 = sys.version_info >= (3, 6)
 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 ff12453..50f156a 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 f72de9e..31fe6fc 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 
<https://github.com/apache/airflow/issues/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

Reply via email to