You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ur...@apache.org on 2021/12/24 10:22:24 UTC

[airflow] branch main updated: Removes Python 3.6 support (#20467)

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

uranusjr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7c45bc3  Removes Python 3.6 support (#20467)
7c45bc3 is described below

commit 7c45bc35e767ff21982636fa2e36bc07c97b9411
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Fri Dec 24 11:21:38 2021 +0100

    Removes Python 3.6 support (#20467)
    
    Co-authored-by: Tzu-ping Chung <ur...@gmail.com>
---
 BREEZE.rst                                         | 14 +++++++-------
 CI.rst                                             |  2 +-
 IMAGES.rst                                         |  2 +-
 breeze-complete                                    |  2 +-
 dev/REFRESHING_CI_CACHE.md                         |  4 ++--
 dev/prepare_prod_docker_images.sh                  |  2 +-
 dev/provider_packages/prepare_provider_packages.py |  2 +-
 dev/retag_docker_images.py                         |  2 +-
 scripts/ci/libraries/_initialization.sh            |  4 ++--
 scripts/ci/selective_ci_checks.sh                  |  2 --
 setup.cfg                                          |  7 ++-----
 setup.py                                           |  5 ++---
 tests/bats/breeze/test_breeze_complete.bats        |  8 ++++----
 13 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/BREEZE.rst b/BREEZE.rst
index 0deae7b..2dbd963 100644
--- a/BREEZE.rst
+++ b/BREEZE.rst
@@ -1271,7 +1271,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 3.7 3.8 3.9 3.6
+                 3.7 3.8 3.9
 
   -a, --install-airflow-version INSTALL_AIRFLOW_VERSION
           Uses different version of Airflow when building PROD image.
@@ -1474,7 +1474,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 3.7 3.8 3.9 3.6
+                 3.7 3.8 3.9
 
   -I, --production-image
           Use production image for entering the environment and builds (not for tests).
@@ -1541,7 +1541,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 3.7 3.8 3.9 3.6
+                 3.7 3.8 3.9
 
   -v, --verbose
           Show verbose information about executed docker, kind, kubectl, helm commands. Useful for
@@ -1632,7 +1632,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 3.7 3.8 3.9 3.6
+                 3.7 3.8 3.9
 
 
   ####################################################################################################
@@ -1827,7 +1827,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 3.7 3.8 3.9 3.6
+                 3.7 3.8 3.9
 
   -b, --backend BACKEND
           Backend to use for tests - it determines which database is used.
@@ -1896,7 +1896,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 3.7 3.8 3.9 3.6
+                 3.7 3.8 3.9
 
   -F, --force-build-images
           Forces building of the local docker images. The images are rebuilt
@@ -2305,7 +2305,7 @@ This is the current syntax for  `./breeze <./breeze>`_:
 
           One of:
 
-                 3.7 3.8 3.9 3.6
+                 3.7 3.8 3.9
 
   ****************************************************************************************************
    Choose backend to run for Airflow
diff --git a/CI.rst b/CI.rst
index 9f289b6..d54d5a1 100644
--- a/CI.rst
+++ b/CI.rst
@@ -662,7 +662,7 @@ have to be percent-encoded when you access them via UI (/ = %2F)
 +--------------+----------------------------------------------------------+----------------------------------------------------------+
 
 * <BRANCH> might be either "main" or "v2-*-test"
-* <X.Y> - Python version (Major + Minor).Should be one of ["3.6", "3.7", "3.8", "3.9"].
+* <X.Y> - Python version (Major + Minor).Should be one of ["3.7", "3.8", "3.9"].
 * <COMMIT_SHA> - full-length SHA of commit either from the tip of the branch (for pushes/schedule) or
   commit from the tip of the branch used for the PR.
 
diff --git a/IMAGES.rst b/IMAGES.rst
index 559ecdb..913cd02 100644
--- a/IMAGES.rst
+++ b/IMAGES.rst
@@ -603,7 +603,7 @@ which checks if the image has been released and will pull it and rebuild it if n
     export FORCE_ANSWER_TO_QUESTIONS="true"
     export CI="true"
 
-    for python_version in "3.6" "3.7" "3.8"
+    for python_version in "3.7" "3.8" "3.9"
     do
             ./breeze build-image --python ${python_version} --build-cache-local \
                     --check-if-python-base-image-updated --verbose
diff --git a/breeze-complete b/breeze-complete
index 2d00258..e05c4f8 100644
--- a/breeze-complete
+++ b/breeze-complete
@@ -23,7 +23,7 @@
 # by the BATS tests automatically during pre-commit and CI
 # Those cannot be made read-only as the breeze-complete must be re-sourceable
 
-_breeze_allowed_python_major_minor_versions="3.7 3.8 3.9 3.6"
+_breeze_allowed_python_major_minor_versions="3.7 3.8 3.9"
 _breeze_allowed_backends="sqlite mysql postgres mssql"
 _breeze_allowed_integrations="cassandra kerberos mongo openldap pinot rabbitmq redis statsd trino all"
 _breeze_allowed_generate_constraints_modes="source-providers pypi-providers no-providers"
diff --git a/dev/REFRESHING_CI_CACHE.md b/dev/REFRESHING_CI_CACHE.md
index b98d97c..889efd7 100644
--- a/dev/REFRESHING_CI_CACHE.md
+++ b/dev/REFRESHING_CI_CACHE.md
@@ -48,7 +48,7 @@ manual refresh might be needed.
 # Manually generating constraint files
 
 ```bash
-export CURRENT_PYTHON_MAJOR_MINOR_VERSIONS_AS_STRING="3.7 3.8 3.9 3.6"
+export CURRENT_PYTHON_MAJOR_MINOR_VERSIONS_AS_STRING="3.7 3.8 3.9"
 for python_version in $(echo "${CURRENT_PYTHON_MAJOR_MINOR_VERSIONS_AS_STRING}")
 do
   ./breeze build-image --upgrade-to-newer-dependencies --python ${python_version} --build-cache-local
@@ -90,5 +90,5 @@ If you have fast network and powerful computer, you can refresh the images in pa
 or with gnu parallel:
 
 ```bash
-parallel -j 4 --linebuffer --tagstring '{}' ./dev/refresh_images.sh ::: 3.7 3.8 3.9 3.6
+parallel -j 4 --linebuffer --tagstring '{}' ./dev/refresh_images.sh ::: 3.7 3.8 3.9
 ```
diff --git a/dev/prepare_prod_docker_images.sh b/dev/prepare_prod_docker_images.sh
index dfccd91..17dd1c7 100755
--- a/dev/prepare_prod_docker_images.sh
+++ b/dev/prepare_prod_docker_images.sh
@@ -20,7 +20,7 @@ export AIRFLOW_SOURCES_DIR
 
 set -e
 
-CURRENT_PYTHON_MAJOR_MINOR_VERSIONS=("3.7" "3.8" "3.9" "3.6")
+CURRENT_PYTHON_MAJOR_MINOR_VERSIONS=("3.7" "3.8" "3.9")
 
 usage() {
     local cmdname
diff --git a/dev/provider_packages/prepare_provider_packages.py b/dev/provider_packages/prepare_provider_packages.py
index 7432bc0..c840348 100755
--- a/dev/provider_packages/prepare_provider_packages.py
+++ b/dev/provider_packages/prepare_provider_packages.py
@@ -52,7 +52,7 @@ from rich.syntax import Syntax
 
 from airflow.utils.yaml import safe_load
 
-ALL_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]
+ALL_PYTHON_VERSIONS = ["3.7", "3.8", "3.9"]
 
 INITIAL_CHANGELOG_CONTENT = """
 
diff --git a/dev/retag_docker_images.py b/dev/retag_docker_images.py
index 09faff0..459f2c5 100755
--- a/dev/retag_docker_images.py
+++ b/dev/retag_docker_images.py
@@ -31,7 +31,7 @@ from typing import List
 
 import click
 
-PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]
+PYTHON_VERSIONS = ["3.7", "3.8", "3.9"]
 
 GHCR_IO_PREFIX = "ghcr.io"
 
diff --git a/scripts/ci/libraries/_initialization.sh b/scripts/ci/libraries/_initialization.sh
index aa59270..533db37 100644
--- a/scripts/ci/libraries/_initialization.sh
+++ b/scripts/ci/libraries/_initialization.sh
@@ -107,11 +107,11 @@ function initialization::initialize_base_variables() {
     export PRODUCTION_IMAGE="false"
 
     # All supported major/minor versions of python in all versions of Airflow
-    ALL_PYTHON_MAJOR_MINOR_VERSIONS+=("3.6" "3.7" "3.8" "3.9")
+    ALL_PYTHON_MAJOR_MINOR_VERSIONS+=("3.7" "3.8" "3.9")
     export ALL_PYTHON_MAJOR_MINOR_VERSIONS
 
     # Currently supported major/minor versions of python
-    CURRENT_PYTHON_MAJOR_MINOR_VERSIONS+=("3.7" "3.8" "3.9" "3.6")
+    CURRENT_PYTHON_MAJOR_MINOR_VERSIONS+=("3.7" "3.8" "3.9")
     export CURRENT_PYTHON_MAJOR_MINOR_VERSIONS
 
     # Currently supported versions of Postgres
diff --git a/scripts/ci/selective_ci_checks.sh b/scripts/ci/selective_ci_checks.sh
index a8da6c1..1f0fbd8 100755
--- a/scripts/ci/selective_ci_checks.sh
+++ b/scripts/ci/selective_ci_checks.sh
@@ -125,9 +125,7 @@ function output_all_basic_variables() {
     initialization::ga_output default-helm-version "${HELM_VERSION}"
 
     if [[ ${FULL_TESTS_NEEDED_LABEL} == "true" ]]; then
-        initialization::ga_output postgres-exclude '[{ "python-version": "3.6" }]'
         initialization::ga_output mysql-exclude '[{ "python-version": "3.7" }, { "python-version": "3.9" }]'
-        initialization::ga_output mssql-exclude '[{ "python-version": "3.6" }, { "python-version": "3.8" }]'
         initialization::ga_output sqlite-exclude '[{ "python-version": "3.7" }, { "python-version": "3.8" }]'
     else
         initialization::ga_output postgres-exclude '[]'
diff --git a/setup.cfg b/setup.cfg
index be2cc4d..f743299 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -54,7 +54,6 @@ classifiers =
     Intended Audience :: Developers
     Intended Audience :: System Administrators
     License :: OSI Approved :: Apache Software License
-    Programming Language :: Python :: 3.6
     Programming Language :: Python :: 3.7
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
@@ -70,7 +69,7 @@ project_urls =
 [options]
 zip_safe = False
 include_package_data = True
-python_requires = ~=3.6
+python_requires = ~=3.7
 packages = find:
 setup_requires =
     gitpython
@@ -86,10 +85,8 @@ install_requires =
     attrs>=20.0, <21.0
     blinker
     cached_property~=1.5;python_version<="3.7"
-    # cattrs >= 1.1.0 dropped support for Python 3.6
-    cattrs>=1.0, <1.1.0;python_version<="3.6"
     # cattrs >= 1.7.0 break lineage - see https://github.com/apache/airflow/issues/16172
-    cattrs~=1.1, <1.7.0;python_version>"3.6"
+    cattrs~=1.1, <1.7.0
     # Required by vendored-in connexion
     clickclick>=1.2
     colorlog>=4.0.2, <6.0
diff --git a/setup.py b/setup.py
index cea42f5..e97e580 100644
--- a/setup.py
+++ b/setup.py
@@ -238,8 +238,7 @@ cloudant = [
 ]
 dask = [
     'cloudpickle>=1.4.1, <1.5.0',
-    'dask<2021.3.1;python_version<"3.7"',  # dask stopped supporting python 3.6 in 2021.3.1 version
-    'dask>=2.9.0, <2021.6.1;python_version>="3.7"',  # dask 2021.6.1 does not work with `distributed`
+    'dask>=2.9.0, <2021.6.1',  # dask 2021.6.1 does not work with `distributed`
     'distributed>=2.11.1, <2.20',
 ]
 databricks = [
@@ -872,7 +871,7 @@ EXTRAS_REQUIREMENTS["devel_ci"] = devel_ci
 
 def sort_extras_requirements() -> Dict[str, List[str]]:
     """
-    For Python 3.6+ the dictionary order remains when keys() are retrieved.
+    The dictionary order remains when keys() are retrieved.
     Sort both: extras and list of dependencies to make it easier to analyse problems
     external packages will be first, then if providers are added they are added at the end of the lists.
     """
diff --git a/tests/bats/breeze/test_breeze_complete.bats b/tests/bats/breeze/test_breeze_complete.bats
index 69c7258..c7a5db9 100644
--- a/tests/bats/breeze/test_breeze_complete.bats
+++ b/tests/bats/breeze/test_breeze_complete.bats
@@ -25,7 +25,7 @@
   source "${AIRFLOW_SOURCES}/breeze-complete"
 
   breeze_complete::get_known_values_breeze "-p"
-  assert_equal "${_breeze_known_values}" "3.7 3.8 3.9 3.6"
+  assert_equal "${_breeze_known_values}" "3.7 3.8 3.9"
 }
 
 @test "Test get_known_values long" {
@@ -34,7 +34,7 @@
   source "${AIRFLOW_SOURCES}/breeze-complete"
 
   breeze_complete::get_known_values_breeze "--python"
-  assert_equal "${_breeze_known_values}" "3.7 3.8 3.9 3.6"
+  assert_equal "${_breeze_known_values}" "3.7 3.8 3.9"
 }
 
 @test "Test wrong get_known_values" {
@@ -125,7 +125,7 @@
   COMP_WORDS=("--python" "")
   breeze_complete::_comp_breeze
 
-  assert_equal "${COMPREPLY[*]}" "3.7 3.8 3.9 3.6"
+  assert_equal "${COMPREPLY[*]}" "3.7 3.8 3.9"
 }
 
 @test "Test autocomplete --python with prefix" {
@@ -136,7 +136,7 @@
   COMP_WORDS=("--python" "3")
   breeze_complete::_comp_breeze
 
-  assert_equal "${COMPREPLY[*]}" "3.7 3.8 3.9 3.6"
+  assert_equal "${COMPREPLY[*]}" "3.7 3.8 3.9"
 }
 
 @test "Test autocomplete build-" {