Skip to content

Commit 9fa75aa

Browse files
authored
Remove Python 3.7 support (apache#30963)
1 parent c55f9ea commit 9fa75aa

File tree

243 files changed

+1424
-1680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+1424
-1680
lines changed

.github/actions/breeze/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ runs:
3737
path: ~/.local/pipx
3838
# README has the latest breeze's hash and python location is used to distinguish between
3939
# different minor versions of python
40-
key: "breeze-${{ env.pythonLocation }}-${{ hashFiles('dev/breeze/README.md') }}"
41-
restore-keys: breeze-${{ env.pythonLocation }}
40+
key: "breeze-3.8-${{ env.pythonLocation }}-${{ hashFiles('dev/breeze/README.md') }}"
41+
restore-keys: breeze-3.8-${{ env.pythonLocation }}
4242
- name: "Install Breeze"
4343
shell: bash
4444
run: ./scripts/ci/install_breeze.sh

.github/actions/build-prod-images/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ runs:
3737
shell: bash
3838
run: breeze ci-image pull --tag-as-latest
3939
env:
40-
PYTHON_MAJOR_MINOR_VERSION: "3.7"
40+
PYTHON_MAJOR_MINOR_VERSION: "3.8"
4141
- name: "Cleanup dist and context file"
4242
shell: bash
4343
run: rm -fv ./dist/* ./docker-context-files/*

.readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ formats: []
2020
sphinx:
2121
configuration: docs/rtd-deprecation/conf.py
2222
python:
23-
version: "3.7"
23+
version: "3.8"
2424
install:
2525
- method: pip
2626
path: .

BREEZE.rst

+37-6
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,17 @@ Run this command to install Breeze (make sure to use ``-e`` flag):
245245
246246
pipx install -e ./dev/breeze
247247
248+
249+
.. note:: Note for Windows users
250+
251+
The ``./dev/breeze`` in command about is a PATH to sub-folder where breeze source packages are.
252+
If you are on Windows, you should use Windows way to point to the ``dev/breeze`` sub-folder
253+
of Airflow either as absolute or relative path. For example:
254+
255+
.. code-block:: bash
256+
257+
pipx install -e dev\breeze
258+
248259
Once this is complete, you should have ``breeze`` binary on your PATH and available to run by ``breeze``
249260
command.
250261

@@ -278,6 +289,26 @@ where it was installed.
278289
You can run ``breeze setup version`` command to see where breeze installed from and what are the current sources
279290
that Breeze works on
280291

292+
.. warning:: Upgrading from earlier Python version
293+
294+
If you used Breeze with Python 3.7 and when running it, it will complain that it needs Python 3.8. In this
295+
case you should force-reinstall Breeze with ``pipx``:
296+
297+
.. code-block:: bash
298+
299+
pipx install --force -e ./dev/breeze
300+
301+
.. note:: Note for Windows users
302+
303+
The ``./dev/breeze`` in command about is a PATH to sub-folder where breeze source packages are.
304+
If you are on Windows, you should use Windows way to point to the ``dev/breeze`` sub-folder
305+
of Airflow either as absolute or relative path. For example:
306+
307+
.. code-block:: bash
308+
309+
pipx install --force -e dev\breeze
310+
311+
281312
Running Breeze for the first time
282313
---------------------------------
283314

@@ -360,12 +391,12 @@ You can use additional ``breeze`` flags to choose your environment. You can spec
360391
version to use, and backend (the meta-data database). Thanks to that, with Breeze, you can recreate the same
361392
environments as we have in matrix builds in the CI.
362393

363-
For example, you can choose to run Python 3.7 tests with MySQL as backend and with mysql version 8
394+
For example, you can choose to run Python 3.8 tests with MySQL as backend and with mysql version 8
364395
as follows:
365396

366397
.. code-block:: bash
367398
368-
breeze --python 3.7 --backend mysql --mysql-version 8
399+
breeze --python 3.8 --backend mysql --mysql-version 8
369400
370401
The choices you make are persisted in the ``./.build/`` cache directory so that next time when you use the
371402
``breeze`` script, it could use the values that were used previously. This way you do not have to specify
@@ -526,15 +557,15 @@ When you are starting airflow from local sources, www asset compilation is autom
526557

527558
.. code-block:: bash
528559
529-
breeze --python 3.7 --backend mysql start-airflow
560+
breeze --python 3.8 --backend mysql start-airflow
530561
531562
532563
You can also use it to start any released version of Airflow from ``PyPI`` with the
533564
``--use-airflow-version`` flag.
534565

535566
.. code-block:: bash
536567
537-
breeze start-airflow --python 3.7 --backend mysql --use-airflow-version 2.2.5
568+
breeze start-airflow --python 3.8 --backend mysql --use-airflow-version 2.2.5
538569
539570
Those are all available flags of ``start-airflow`` command:
540571

@@ -1422,10 +1453,10 @@ suffix and they need to also be paired with corresponding runtime dependency add
14221453
14231454
.. code-block:: bash
14241455
1425-
breeze prod-image build --python 3.7 --additional-dev-deps "libasound2-dev" \
1456+
breeze prod-image build --python 3.8 --additional-dev-deps "libasound2-dev" \
14261457
--additional-runtime-apt-deps "libasound2"
14271458
1428-
Same as above but uses python 3.7.
1459+
Same as above but uses python 3.8.
14291460
14301461
Building PROD image
14311462
...................

CI.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ have to be percent-encoded when you access them via UI (/ = %2F)
145145
+--------------+----------------------------------------------------------+----------------------------------------------------------+
146146

147147
* <BRANCH> might be either "main" or "v2-*-test"
148-
* <X.Y> - Python version (Major + Minor).Should be one of ["3.7", "3.8", "3.9"].
148+
* <X.Y> - Python version (Major + Minor).Should be one of ["3.8", "3.9", "3.10", "3.11"].
149149
* <COMMIT_SHA> - full-length SHA of commit either from the tip of the branch (for pushes/schedule) or
150150
commit from the tip of the branch used for the PR.
151151
@@ -523,9 +523,9 @@ For example knowing that the CI job was for commit ``cd27124534b46c9688a1d89e75f
523523

524524
.. code-block:: bash
525525
526-
docker pull ghcr.io/apache/airflow/main/ci/python3.7:cd27124534b46c9688a1d89e75fcd137ab5137e3
526+
docker pull ghcr.io/apache/airflow/main/ci/python3.8:cd27124534b46c9688a1d89e75fcd137ab5137e3
527527
528-
docker run -it ghcr.io/apache/airflow/main/ci/python3.7:cd27124534b46c9688a1d89e75fcd137ab5137e3
528+
docker run -it ghcr.io/apache/airflow/main/ci/python3.8:cd27124534b46c9688a1d89e75fcd137ab5137e3
529529
530530
531531
But you usually need to pass more variables and complex setup if you want to connect to a database or

CONTRIBUTING.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ these guidelines:
414414
- Run tests locally before opening PR.
415415

416416
- You can use any supported python version to run the tests, but the best is to check
417-
if it works for the oldest supported version (Python 3.7 currently). In rare cases
417+
if it works for the oldest supported version (Python 3.8 currently). In rare cases
418418
tests might fail with the oldest version when you use features that are available in newer Python
419419
versions. For that purpose we have ``airflow.compat`` package where we keep back-ported
420420
useful features from newer versions.
@@ -840,7 +840,7 @@ from the PyPI package:
840840
.. code-block:: bash
841841
842842
pip install apache-airflow[google,amazon,async]==2.2.5 \
843-
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.2.5/constraints-3.7.txt"
843+
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.2.5/constraints-3.8.txt"
844844
845845
The last one can be used to install Airflow in "minimal" mode - i.e when bare Airflow is installed without
846846
extras.
@@ -852,15 +852,15 @@ requirements).
852852
.. code-block:: bash
853853
854854
pip install -e . \
855-
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-source-providers-3.7.txt"
855+
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-source-providers-3.8.txt"
856856
857857
858858
This works also with extras - for example:
859859

860860
.. code-block:: bash
861861
862862
pip install ".[ssh]" \
863-
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-source-providers-3.7.txt"
863+
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-source-providers-3.8.txt"
864864
865865
866866
There are different set of fixed constraint files for different python major/minor versions and you should
@@ -872,7 +872,7 @@ If you want to update just airflow dependencies, without paying attention to pro
872872
.. code-block:: bash
873873
874874
pip install . --upgrade \
875-
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-no-providers-3.7.txt"
875+
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-main/constraints-no-providers-3.8.txt"
876876
877877
878878
The ``constraints-<PYTHON_MAJOR_MINOR_VERSION>.txt`` and ``constraints-no-providers-<PYTHON_MAJOR_MINOR_VERSION>.txt``

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ARG AIRFLOW_USER_HOME_DIR=/home/airflow
4646
# latest released version here
4747
ARG AIRFLOW_VERSION="2.6.1"
4848

49-
ARG PYTHON_BASE_IMAGE="python:3.7-slim-bullseye"
49+
ARG PYTHON_BASE_IMAGE="python:3.8-slim-bullseye"
5050

5151
ARG AIRFLOW_PIP_VERSION=23.1.2
5252
ARG AIRFLOW_IMAGE_REPOSITORY="https://github.com/apache/airflow"

Dockerfile.ci

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# WARNING: THIS DOCKERFILE IS NOT INTENDED FOR PRODUCTION USE OR DEPLOYMENT.
1818
#
19-
ARG PYTHON_BASE_IMAGE="python:3.7-slim-bullseye"
19+
ARG PYTHON_BASE_IMAGE="python:3.8-slim-bullseye"
2020

2121
##############################################################################################
2222
# This is the script image where we keep all inlined bash scripts needed in other segments
@@ -615,7 +615,7 @@ chmod 1777 /tmp
615615

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

618-
PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.7}
618+
PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:=3.8}
619619

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

0 commit comments

Comments
 (0)