diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml index 5e36177855..1ebf84a3d1 100644 --- a/.github/workflows/python_lint.yml +++ b/.github/workflows/python_lint.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - name: Checkout diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15c408c8f9..f78c22a945 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,12 +56,14 @@ variables: # Docker images BOT_DOCKER_IMAGE_TAG: ":latest" - ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v5.0:1" - AFL_FUZZER_TEST_IMAGE: "${CI_DOCKER_REGISTRY}/afl-fuzzer-test-v5.0:1-1" - CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis-v5.0:1-1" - ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.0:1-2" + + ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.0:2-2" + ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env-v5.0:2" + AFL_FUZZER_TEST_IMAGE: "$CI_DOCKER_REGISTRY/afl-fuzzer-test-v5.0:2-1" + CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis-v5.0:2-1" + SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:3" - LINUX_SHELL_IMAGE: "${CI_DOCKER_REGISTRY}/linux-shells:2" + LINUX_SHELL_IMAGE: "${CI_DOCKER_REGISTRY}/linux-shells-v5.0:2" # target test config file, used by assign test job CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/.gitlab/ci/target-test.yml" diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index 86dc64b3f2..80aa6cc0ff 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -21,7 +21,7 @@ - job: fast_template_app artifacts: false variables: - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 artifacts: paths: - "**/build*/size.json" @@ -202,7 +202,7 @@ build_ssc_esp32s3: OUTPUT_PATH: ${CI_PROJECT_DIR}/tools/unit-test-app/output BUILD_SYSTEM: "cmake" TEST_TYPE: "unit_test" - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 LDGEN_CHECK_MAPPING: 1 script: - ${IDF_PATH}/tools/ci/find_apps_build_apps.sh @@ -260,7 +260,7 @@ build_esp_idf_tests_cmake_esp32c2: TEST_TYPE: example_test LOG_PATH: ${CI_PROJECT_DIR}/log_${TEST_PREFIX} BUILD_PATH: ${CI_PROJECT_DIR}/build_${TEST_PREFIX} - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 LDGEN_CHECK_MAPPING: 1 script: # it's not possible to build 100% out-of-tree and have the "artifacts" diff --git a/.gitlab/ci/docs.yml b/.gitlab/ci/docs.yml index 6ef800c6fc..6da17e6f12 100644 --- a/.gitlab/ci/docs.yml +++ b/.gitlab/ci/docs.yml @@ -58,7 +58,7 @@ check_docs_lang_sync: .build_docs_template: image: $ESP_IDF_DOC_ENV_IMAGE variables: - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 tags: - build_docs dependencies: [] @@ -74,7 +74,7 @@ check_docs_lang_sync: check_docs_gh_links: image: $ESP_IDF_DOC_ENV_IMAGE variables: - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 extends: - .pre_check_job_template - .doc-rules:build:docs @@ -151,7 +151,7 @@ build_docs_pdf: - .before_script_no_sync_submodule image: $ESP_IDF_DOC_ENV_IMAGE variables: - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/" PYTHONUNBUFFERED: 1 stage: test_deploy diff --git a/.gitlab/ci/host-test.yml b/.gitlab/ci/host-test.yml index 02de85ab79..c6650ef8dc 100644 --- a/.gitlab/ci/host-test.yml +++ b/.gitlab/ci/host-test.yml @@ -3,7 +3,7 @@ stage: host_test image: $ESP_ENV_IMAGE variables: - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 tags: - host_test dependencies: [] diff --git a/.gitlab/ci/pre_check.yml b/.gitlab/ci/pre_check.yml index aa69df9abe..7677bf217f 100644 --- a/.gitlab/ci/pre_check.yml +++ b/.gitlab/ci/pre_check.yml @@ -52,7 +52,7 @@ check_python_style: - .pre_check_base_template - .rules:patterns:python-files variables: - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 artifacts: when: on_failure paths: @@ -64,7 +64,7 @@ check_python_style: test_check_kconfigs: extends: .pre_check_job_template variables: - PYTHON_VER: 3.6.13 + PYTHON_VER: 3.7.10 artifacts: when: on_failure paths: diff --git a/docs/en/api-guides/build-system.rst b/docs/en/api-guides/build-system.rst index 6c41cfe54c..dbf941dfcd 100644 --- a/docs/en/api-guides/build-system.rst +++ b/docs/en/api-guides/build-system.rst @@ -80,8 +80,6 @@ For commands that are not known to ``idf.py`` an attempt to execute them as a bu The command ``idf.py`` supports `shell autocompletion `_ for bash, zsh and fish shells. -In order to make `shell autocompletion `_ supported, please make sure you have at least Python 3.5 and `click `_ 7.1 or newer (:ref:`see also `). - To enable autocompletion for ``idf.py`` use the ``export`` command (:ref:`see this `). Autocompletion is initiated by pressing the TAB key. Type "idf.py -" and press the TAB key to autocomplete options. The autocomplete support for PowerShell is planned in the future. @@ -192,7 +190,7 @@ For more detailed information about integrating ESP-IDF with CMake into an IDE, Setting up the Python Interpreter --------------------------------- -ESP-IDF works well with all supported Python versions. It should work out-of-box even if you have a legacy system where the default ``python`` interpreter is still Python 2.7, however, it is advised to switch to Python 3 if possible. +ESP-IDF works well with Python version 3.7+. ``idf.py`` and other Python scripts will run with the default Python interpreter, i.e. ``python``. You can switch to a different one like ``python3 $IDF_PATH/tools/idf.py ...``, or you can set up a shell alias or another script to simplify the command. diff --git a/docs/en/api-guides/tools/idf-docker-image.rst b/docs/en/api-guides/tools/idf-docker-image.rst index 5d89108fed..6cf8a16431 100644 --- a/docs/en/api-guides/tools/idf-docker-image.rst +++ b/docs/en/api-guides/tools/idf-docker-image.rst @@ -9,7 +9,7 @@ IDF Docker image (``espressif/idf``) is intended for building applications and l The image contains: - Common utilities such as git, wget, curl, zip. -- Python 3.6 or newer. +- Python 3.7 or newer. - A copy of a specific version of ESP-IDF (see below for information about versions). ``IDF_PATH`` environment variable is set, and points to ESP-IDF location in the container. - All the build tools required for the specific version of ESP-IDF: CMake, ninja, cross-compiler toolchains, etc. - All Python packages required by ESP-IDF are installed in a virtual environment. diff --git a/docs/en/contribute/install-pre-commit-hook.rst b/docs/en/contribute/install-pre-commit-hook.rst index 688ad5cc76..df1b2d12e9 100644 --- a/docs/en/contribute/install-pre-commit-hook.rst +++ b/docs/en/contribute/install-pre-commit-hook.rst @@ -4,7 +4,7 @@ Install pre-commit Hook for ESP-IDF Project Required Dependency ------------------- -Python 3.6.1 or above. This is our recommended python version for IDF developers. +Python 3.7.* or above. This is our recommended python version for IDF developers. If you still have python versions not compatible, update your python versions before installing the pre-commit hook. diff --git a/docs/en/get-started/linux-setup.rst b/docs/en/get-started/linux-setup.rst index 2fce376cbb..d41ae82baa 100644 --- a/docs/en/get-started/linux-setup.rst +++ b/docs/en/get-started/linux-setup.rst @@ -38,7 +38,7 @@ With some Linux distributions you may get the ``Failed to open port /dev/ttyUSB0 Python compatibility ==================== -ESP-IDF supports Python 3.6 or newer. It is recommended to upgrade your operating system to a recent version satisfying this requirement. Other options include the installation of Python from `sources `_ or the use of a Python version management system such as `pyenv `_. +ESP-IDF supports Python 3.7 or newer. It is recommended to upgrade your operating system to a recent version satisfying this requirement. Other options include the installation of Python from `sources `_ or the use of a Python version management system such as `pyenv `_. Next Steps ========== diff --git a/docs/zh_CN/get-started/linux-setup.rst b/docs/zh_CN/get-started/linux-setup.rst index a7f58d22e4..5d7d414ef4 100644 --- a/docs/zh_CN/get-started/linux-setup.rst +++ b/docs/zh_CN/get-started/linux-setup.rst @@ -38,7 +38,7 @@ Linux 平台工具链的标准设置 兼容的 Python 版本 ================================= -ESP-IDF 支持 Python 3.6 及以上版本,建议升级操作系统到最新版本从而更新 Python。也可选择从 `sources `_ 安装最新版 Python,或使用 Python 管理系统如 `pyenv `_ 对版本进行升级管理。 +ESP-IDF 支持 Python 3.7 及以上版本,建议升级操作系统到最新版本从而更新 Python。也可选择从 `sources `_ 安装最新版 Python,或使用 Python 管理系统如 `pyenv `_ 对版本进行升级管理。 后续步骤 ========== diff --git a/tools/ci/setup_python.sh b/tools/ci/setup_python.sh index 5b24c1eff9..bd77ba7a3c 100644 --- a/tools/ci/setup_python.sh +++ b/tools/ci/setup_python.sh @@ -4,7 +4,7 @@ if [ -z ${PYTHON_VER+x} ]; then # Use this version of the Python interpreter if it was not defined before. # 3.6.13 is the default python3 interpreter in esp32-ci-env # Jobs which doesn't support this version should define PYTHON_VER themselves - PYTHON_VER=3.6.13 + PYTHON_VER=3.7.10 fi if [ -f /opt/pyenv/activate ]; diff --git a/tools/python_version_checker.py b/tools/python_version_checker.py index ca1c73bd87..740aadc8cd 100644 --- a/tools/python_version_checker.py +++ b/tools/python_version_checker.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD # # SPDX-License-Identifier: Apache-2.0 # @@ -6,7 +6,7 @@ # # There are related tools/detect_python.{sh,fish} scripts which are called earlier when the paths are not properly # set-up and they only intend to prefer the use of Python 3 over Python 2. Why not more? All possible executables -# (python3.6, python3.7, ...) cannot be hardcoded there and at the end, the user is responsible to set-up a system +# (python3.7, python3.8, ...) cannot be hardcoded there and at the end, the user is responsible to set-up a system # where "python" or "python3" of compatible version is available. import sys @@ -18,7 +18,7 @@ try: except ImportError: pass -OLDEST_PYTHON_SUPPORTED = (3, 6) # keep it as tuple for comparison with sys.version_info +OLDEST_PYTHON_SUPPORTED = (3, 7) # keep it as tuple for comparison with sys.version_info def _ver_to_str(it): # type: (Iterable) -> str @@ -31,6 +31,9 @@ def is_supported(): # type: () -> bool def check(): # type: () -> None if not is_supported(): - raise RuntimeError('ESP-IDF supports Python {} or newer but you are using Python {}. Please upgrade your ' - 'installation as described in the documentation.'.format(_ver_to_str(OLDEST_PYTHON_SUPPORTED), - _ver_to_str(sys.version_info[:3]))) + raise RuntimeError( + 'ESP-IDF supports Python {} or newer but you are using Python {}. Please upgrade your ' + 'installation as described in the documentation.'.format( + _ver_to_str(OLDEST_PYTHON_SUPPORTED), _ver_to_str(sys.version_info[:3]) + ) + )