Skip to content

Commit

Permalink
[FIX] remove python 3.6 (#23409)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelauv authored May 3, 2022
1 parent 6f146e7 commit af54630
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ repos:
- "4"
files: ^chart/values\.schema\.json$|^chart/values_schema\.schema\.json$
pass_filenames: true
# TODO: Bump to Python 3.7 when support for Python 3.6 is dropped in Airflow 2.3.
# TODO: Bump to Python 3.8 when support for Python 3.7 is dropped in Airflow.
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
name: Upgrade Python code automatically
args: ["--py36-plus"]
args: ["--py37-plus"]
exclude: ^airflow/_vendor/
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions CI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,9 @@ For example knowing that the CI job was for commit ``cd27124534b46c9688a1d89e75f

.. code-block:: bash
docker pull ghcr.io/apache/airflow/main/ci/python3.6:cd27124534b46c9688a1d89e75fcd137ab5137e3
docker pull ghcr.io/apache/airflow/main/ci/python3.7:cd27124534b46c9688a1d89e75fcd137ab5137e3
docker run -it ghcr.io/apache/airflow/main/ci/python3.6:cd27124534b46c9688a1d89e75fcd137ab5137e3
docker run -it ghcr.io/apache/airflow/main/ci/python3.7:cd27124534b46c9688a1d89e75fcd137ab5137e3
But you usually need to pass more variables and complex setup if you want to connect to a database or
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ chmod 1777 /tmp

AIRFLOW_SOURCES=$(cd "${IN_CONTAINER_DIR}/../.." || exit 1; pwd)

PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.6}
PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.7}

export AIRFLOW_HOME=${AIRFLOW_HOME:=${HOME}}

Expand Down Expand Up @@ -983,7 +983,7 @@ chmod 1777 /tmp

AIRFLOW_SOURCES=$(cd "${IN_CONTAINER_DIR}/../.." || exit 1; pwd)

PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.6}
PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.7}

export AIRFLOW_HOME=${AIRFLOW_HOME:=${HOME}}

Expand Down
16 changes: 8 additions & 8 deletions IMAGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ This will build the image using command similar to:
pip install \
apache-airflow[async,amazon,celery,cncf.kubernetes,docker,dask,elasticsearch,ftp,grpc,hashicorp,http,ldap,google,microsoft.azure,mysql,postgres,redis,sendgrid,sftp,slack,ssh,statsd,virtualenv]==2.0.0 \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.0.0/constraints-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.0.0/constraints-3.7.txt"
.. note::

Expand All @@ -158,7 +158,7 @@ HEAD of development for constraints):
.. code-block:: bash
pip install "https://github.com/apache/airflow/archive/<tag>.tar.gz#egg=apache-airflow" \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.7.txt"
You can also skip installing airflow and install it from locally provided files by using
``--install-packages-from-context`` parameter to Breeze:
Expand Down Expand Up @@ -365,7 +365,7 @@ The following build arguments (``--build-arg`` in docker build command) can be u
+==========================================+==========================================+==========================================+
| ``PYTHON_BASE_IMAGE`` | ``python:3.7-slim-bullseye`` | Base Python image |
+------------------------------------------+------------------------------------------+------------------------------------------+
| ``PYTHON_MAJOR_MINOR_VERSION`` | ``3.6`` | major/minor version of Python (should |
| ``PYTHON_MAJOR_MINOR_VERSION`` | ``3.7`` | major/minor version of Python (should |
| | | match base image) |
+------------------------------------------+------------------------------------------+------------------------------------------+
| ``DEPENDENCIES_EPOCH_NUMBER`` | ``2`` | increasing this number will reinstall |
Expand Down Expand Up @@ -485,7 +485,7 @@ This builds the CI image in version 3.7 with default extras ("all").
--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" --tag my-image:0.0.1
This builds the CI image in version 3.6 with "gcp" extra only.
This builds the CI image in version 3.7 with "gcp" extra only.

.. code-block:: bash
Expand All @@ -495,7 +495,7 @@ This builds the CI image in version 3.6 with "gcp" extra only.
--build-arg AIRFLOW_EXTRAS=gcp --tag my-image:0.0.1
This builds the CI image in version 3.6 with "apache-beam" extra added.
This builds the CI image in version 3.7 with "apache-beam" extra added.

.. code-block:: bash
Expand All @@ -504,7 +504,7 @@ This builds the CI image in version 3.6 with "apache-beam" extra added.
--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
--build-arg ADDITIONAL_AIRFLOW_EXTRAS="apache-beam" --tag my-image:0.0.1
This builds the CI image in version 3.6 with "mssql" additional package added.
This builds the CI image in version 3.7 with "mssql" additional package added.

.. code-block:: bash
Expand All @@ -513,7 +513,7 @@ This builds the CI image in version 3.6 with "mssql" additional package added.
--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
--build-arg ADDITIONAL_PYTHON_DEPS="mssql" --tag my-image:0.0.1
This builds the CI image in version 3.6 with "gcc" and "g++" additional apt dev dependencies added.
This builds the CI image in version 3.7 with "gcc" and "g++" additional apt dev dependencies added.

.. code-block::
Expand All @@ -522,7 +522,7 @@ This builds the CI image in version 3.6 with "gcc" and "g++" additional apt dev
--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye" \
--build-arg ADDITIONAL_DEV_APT_DEPS="gcc g++" --tag my-image:0.0.1
This builds the CI image in version 3.6 with "jdbc" extra and "default-jre-headless" additional apt runtime dependencies added.
This builds the CI image in version 3.7 with "jdbc" extra and "default-jre-headless" additional apt runtime dependencies added.

.. code-block::
Expand Down
12 changes: 6 additions & 6 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ python setup.py install
# There are different constraint files for different python versions. For example"

pip install . \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.7.txt"


By default `pip install` in Airflow 2.0 installs only the provider packages that are needed by the extras and
install them as packages from PyPI rather than from local sources:

pip install .[google,amazon] \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.7.txt"


You can upgrade just airflow, without paying attention to provider's dependencies by using 'no-providers'
constraint files. This allows you to keep installed provider packages.

pip install . --upgrade \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-no-providers-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-no-providers-3.7.txt"


You can also install airflow in "editable mode" (with -e) flag and then provider packages are
Expand All @@ -75,21 +75,21 @@ and in ``CONTRIBUTING.rst`` for developing community maintained providers.
This is useful if you want to develop providers:

pip install -e . \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.7.txt"

You can also skip installing provider packages from PyPI by setting INSTALL_PROVIDERS_FROM_SOURCE to "true".
In this case Airflow will be installed in non-editable mode with all providers installed from the sources.
Additionally `provider.yaml` files will also be copied to providers folders which will make the providers
discoverable by Airflow even if they are not installed from packages in this case.

INSTALL_PROVIDERS_FROM_SOURCES="true" pip install . \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.7.txt"

Airflow can be installed with extras to install some additional features (for example 'async' or 'doc' or
to install automatically providers and all dependencies needed by that provider:

pip install .[async,google,amazon] \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-3.7.txt"

The list of available extras:

Expand Down
2 changes: 1 addition & 1 deletion PULL_REQUEST_WORKFLOW.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ We approached the problem by:
* Backed version (currently MySQL 5.7, MySQL 8, Postgres 13

We've decided that instead of running all the combinations of parameters for all matrix component we will
only run default values (Python 3.6, Mysql 5.7, Postgres 13) for all PRs which are not approved yet by
only run default values (Python 3.7, Mysql 5.7, Postgres 13) for all PRs which are not approved yet by
the committers. This has a nice effect, that full set of tests (though with limited combinations of
the matrix) are still run in the CI for every Pull Request that needs tests at all - allowing the
contributors to make sure that their PR is "good enough" to be reviewed.
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ Airflow is not a streaming solution, but it is often used to process real-time d

Apache Airflow is tested with:

| | Main version (dev) | Stable version (2.3.0) |
|---------------------|-------------------------|-------------------------|
| Python | 3.7, 3.8, 3.9, 3.10 | 3.6, 3.7, 3.8, 3.9 |
| Platform | AMD64/ARM64(\*) | AMD64 |
| Kubernetes | 1.20, 1.21, 1.22, 1.23 | 1.20, 1.21, 1.22, 1.23 |
| PostgreSQL | 10, 11, 12, 13 | 9.6, 10, 11, 12, 13 |
| MySQL | 5.7, 8 | 5.7, 8 |
| SQLite | 3.15.0+ | 3.15.0+ |
| MSSQL | 2017(\*), 2019 (\*) | |
| | Main version (dev) | Stable version (2.3.0) |
|---------------------|-------------------------|------------------------|
| Python | 3.7, 3.8, 3.9, 3.10 | 3.7, 3.8, 3.9, 3.10 |
| Platform | AMD64/ARM64(\*) | AMD64/ARM64(\*) |
| Kubernetes | 1.20, 1.21, 1.22, 1.23 | 1.20, 1.21, 1.22, 1.23 |
| PostgreSQL | 10, 11, 12, 13 | 10, 11, 12, 13 |
| MySQL | 5.7, 8 | 5.7, 8 |
| SQLite | 3.15.0+ | 3.15.0+ |
| MSSQL | 2017(\*), 2019 (\*) | 2017(\*), 2019 (\*) |

\* Experimental

Expand Down
2 changes: 1 addition & 1 deletion STATIC_CODE_CHECKS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use. So, you can be sure your modifications will also work for CI if they pass
pre-commit hooks.

We have integrated the fantastic `pre-commit <https://pre-commit.com>`__ framework
in our development workflow. To install and use it, you need at least Python 3.6 locally.
in our development workflow. To install and use it, you need at least Python 3.7 locally.

Installing pre-commit hooks
...........................
Expand Down
2 changes: 1 addition & 1 deletion TESTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ Breeze session. They are usually expensive to run.
.. code-block:: bash
breeze stop
breeze --python 3.6 --db-reset --forward-credentials
breeze --python 3.7 --db-reset --forward-credentials
2. Run create action in helper (to create slowly created resources):

Expand Down
2 changes: 1 addition & 1 deletion dev/README_RELEASE_AIRFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ Optionally it can be followed with constraints
```shell script
pip install apache-airflow==<VERSION>rc<X> \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-<VERSION>/constraints-3.6.txt"`
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-<VERSION>/constraints-3.7.txt"`
```
Note that the constraints contain python version that you are installing it with.
Expand Down
2 changes: 1 addition & 1 deletion dev/README_RELEASE_PROVIDER_PACKAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ do
svn mv "${file}" "${base_file//rc[0-9]/}"
done

# Check which old packages will be removed (you need python 3.6+)
# Check which old packages will be removed (you need python 3.7+)
python ${AIRFLOW_REPO_ROOT}/dev/provider_packages/remove_old_releases.py \
--directory .

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ There are a few properties of Breeze/CI scripts that should be maintained though
run a command and get everything done with the least number of prerequisites

* The prerequisites for Breeze and CI are:
* Python 3.7+ (Python 3.6 end of life is December 2021)
* Python 3.7+ (Python 3.7 end of life is Jun 2023)
* Docker (TBD which minimum version supported)
* Docker Compose (TBD which minimum version supported)
* No other tools and CLI commands should be needed
Expand Down
2 changes: 1 addition & 1 deletion dev/provider_packages/prepare_provider_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ def get_provider_jinja_context(
supported_python_versions = [
p for p in ALL_PYTHON_VERSIONS if p not in provider_details.excluded_python_versions
]
python_requires = "~=3.6"
python_requires = "~=3.7"
for p in provider_details.excluded_python_versions:
python_requires += f", !={p}"
context: Dict[str, Any] = {
Expand Down
4 changes: 2 additions & 2 deletions docker_tests/docker_tests_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def display_dependency_conflict_message():
CI image:
./breeze build-image --upgrade-to-newer-dependencies --python 3.6
./breeze build-image --upgrade-to-newer-dependencies --python 3.7
Production image:
./breeze build-image --production-image --upgrade-to-newer-dependencies --python 3.6
./breeze build-image --production-image --upgrade-to-newer-dependencies --python 3.7
* You will see error messages there telling which requirements are conflicting and which packages caused the
conflict. Add the limitation that caused the conflict to EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/extra-packages-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ with a consistent set of dependencies based on constraint files provided by Airf
:substitutions:
pip install apache-airflow[google,amazon,apache.spark]==|version| \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-|version|/constraints-3.6.txt"
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-|version|/constraints-3.7.txt"
Note, that this will install providers in the versions that were released at the time of Airflow |version| release. You can later
upgrade those providers manually if you want to use latest versions of the providers.
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/howto/set-up-database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You can make sure which version is used by the interpreter by running this check
.. code-block:: bash
root@b8a8e73caa2c:/opt/airflow# python
Python 3.6.12 (default, Nov 25 2020, 03:59:00)
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Expand Down
10 changes: 5 additions & 5 deletions docs/apache-airflow/installation/installing-from-pypi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Typical command to install airflow from PyPI looks like below:

.. code-block::
pip install "apache-airflow[celery]==|version|" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-|version|/constraints-3.6.txt"
pip install "apache-airflow[celery]==|version|" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-|version|/constraints-3.7.txt"
This is an example, see further for more explanation.

Expand Down Expand Up @@ -142,7 +142,7 @@ in specific version.
.. code-block:: bash
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)"
# For example: 3.6
# For example: 3.7
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-${PYTHON_VERSION}.txt"
pip install "apache-airflow-providers-google" --constraint "${CONSTRAINT_URL}"
Expand All @@ -151,7 +151,7 @@ You can also upgrade the providers to latest versions (you need to use main vers
.. code-block:: bash
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)"
# For example: 3.6
# For example: 3.7
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-${PYTHON_VERSION}.txt"
pip install "apache-airflow-providers-google" --upgrade --constraint "${CONSTRAINT_URL}"
Expand All @@ -166,9 +166,9 @@ If you don't want to install any extra providers, initially you can use the comm
AIRFLOW_VERSION=|version|
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)"
# For example: 3.6
# For example: 3.7
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-no-providers-${PYTHON_VERSION}.txt"
# For example: https://raw.githubusercontent.com/apache/airflow/constraints-|version|/constraints-no-providers-3.6.txt
# For example: https://raw.githubusercontent.com/apache/airflow/constraints-|version|/constraints-no-providers-3.7.txt
pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/installation/prerequisites.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ 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.
Starting with Airflow 2.3.0, Airflow is tested with Python 3.7, 3.8, 3.9 and 3.10.

The minimum memory required we recommend Airflow to run with is 4GB, but the actual requirements depends
wildly on the deployment options you have
Expand Down
4 changes: 2 additions & 2 deletions docs/apache-airflow/start/local.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ constraint files to enable reproducible installation, so using ``pip`` and const
# Install Airflow using the constraints file
AIRFLOW_VERSION=|version|
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)"
# For example: 3.6
# For example: 3.7
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
# For example: https://raw.githubusercontent.com/apache/airflow/constraints-|version|/constraints-3.6.txt
# For example: https://raw.githubusercontent.com/apache/airflow/constraints-|version|/constraints-3.7.txt
pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
# The Standalone command will initialise the database, make a user,
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/entrypoint_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ chmod 1777 /tmp

AIRFLOW_SOURCES=$(cd "${IN_CONTAINER_DIR}/../.." || exit 1; pwd)

PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.6}
PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.7}

export AIRFLOW_HOME=${AIRFLOW_HOME:=${HOME}}

Expand Down

0 comments on commit af54630

Please sign in to comment.