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

potiuk 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 20cb9f1770 Upgrade to newer build dependencies including the right 
Python version (#38443)
20cb9f1770 is described below

commit 20cb9f1770c819f31e48748fc9fb86527f739d6e
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sun Mar 24 23:50:59 2024 +0100

    Upgrade to newer build dependencies including the right Python version 
(#38443)
    
    This change upgrades build dependencies, including the fact that for
    earlier Python versions, the set of dependencies might be different than
    than for later ones. This PR assumes that default python version (3.8)
    is installed in the environment and on path and will refuxe to run the
    pre-commit if it is not.
---
 .github/workflows/basic-tests.yml                                 | 8 +++++++-
 .../workflows/static-checks-mypy-and-constraints-generation.yml   | 6 ++++++
 pyproject.toml                                                    | 1 +
 scripts/ci/pre_commit/pre_commit_update_build_dependencies.py     | 7 ++++++-
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/basic-tests.yml 
b/.github/workflows/basic-tests.yml
index faf0d3963d..de70535a8d 100644
--- a/.github/workflows/basic-tests.yml
+++ b/.github/workflows/basic-tests.yml
@@ -207,12 +207,18 @@ jobs:
           persist-credentials: false
       - name: Cleanup docker
         uses: ./.github/actions/cleanup-docker
+      - name: "Setup python"
+        uses: actions/setup-python@v5
+        with:
+          python-version: ${{ inputs.default-python-version }}
+          cache: 'pip'
+          cache-dependency-path: ./dev/breeze/pyproject.toml
       - name: "Setup python"
         uses: actions/setup-python@v5
         with:
           python-version: "${{ inputs.default-python-version }}"
           cache: 'pip'
-          cache-dependency-path: ./dev/breeze/setup*
+          cache-dependency-path: ./dev/breeze/pyproject.toml
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
         id: breeze
diff --git 
a/.github/workflows/static-checks-mypy-and-constraints-generation.yml 
b/.github/workflows/static-checks-mypy-and-constraints-generation.yml
index d083183516..3130c23a25 100644
--- a/.github/workflows/static-checks-mypy-and-constraints-generation.yml
+++ b/.github/workflows/static-checks-mypy-and-constraints-generation.yml
@@ -162,6 +162,12 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
+      - name: "Setup python"
+        uses: actions/setup-python@v5
+        with:
+          python-version: ${{ inputs.default-python-version }}
+          cache: 'pip'
+          cache-dependency-path: ./dev/breeze/pyproject.toml
       - name: Cleanup docker
         uses: ./.github/actions/cleanup-docker
       - name: "Prepare breeze & CI image: ${{ 
inputs.default-python-version}}:${{ inputs.image-tag }}"
diff --git a/pyproject.toml b/pyproject.toml
index 55f9592ecc..77b7f9e2ae 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -29,6 +29,7 @@ requires = [
     "pathspec==0.12.1",
     "pluggy==1.4.0",
     "smmap==5.0.1",
+    "tomli==2.0.1; python_version < '3.11'",
     "trove-classifiers==2024.3.3",
 ]
 build-backend = "hatchling.build"
diff --git a/scripts/ci/pre_commit/pre_commit_update_build_dependencies.py 
b/scripts/ci/pre_commit/pre_commit_update_build_dependencies.py
index af0916bbd3..e32a8b2bb5 100755
--- a/scripts/ci/pre_commit/pre_commit_update_build_dependencies.py
+++ b/scripts/ci/pre_commit/pre_commit_update_build_dependencies.py
@@ -37,11 +37,16 @@ FILES_TO_REPLACE_HATCHLING_IN = [
 
 files_changed = False
 
+
 if __name__ == "__main__":
+    python38_bin = shutil.which("python3.8")
+    if not python38_bin:
+        print("Python 3.8 is required to run this script.")
+        sys.exit(1)
     temp_dir = Path(tempfile.mkdtemp())
     hatchling_spec = ""
     try:
-        subprocess.check_call([sys.executable, "-m", "venv", 
temp_dir.as_posix()])
+        subprocess.check_call([python38_bin, "-m", "venv", 
temp_dir.as_posix()])
         venv_python = temp_dir / "bin" / "python"
         subprocess.check_call([venv_python, "-m", "pip", "install", 
"gitpython", "hatchling"])
         frozen_deps = subprocess.check_output([venv_python, "-m", "pip", 
"freeze"], text=True)

Reply via email to