You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2024/03/27 19:25:06 UTC

(airflow) branch main updated: Fix to long constraint generation in `pip` builds (#38541)

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 8bf20dce1a Fix to long constraint generation in `pip` builds (#38541)
8bf20dce1a is described below

commit 8bf20dce1a0f2c1275e240ae33d5e5d614fa6fe8
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Wed Mar 27 20:24:59 2024 +0100

    Fix to long constraint generation in `pip` builds (#38541)
    
    Even if we are using `pip` to generate image, we still want to make sure
    constraints generation is done by UV as it is far more efficient.
    
    This PR fixes too long constraint generation we seein v2-* branch now.
    
    It also adds missing break in constraint generation that produces
    a misleading warning that chicken-egg provider package has not been
    used.
---
 .github/workflows/prod-image-build.yml           | 3 +++
 scripts/in_container/run_generate_constraints.py | 1 +
 2 files changed, 4 insertions(+)

diff --git a/.github/workflows/prod-image-build.yml b/.github/workflows/prod-image-build.yml
index 02a502653b..77136047d6 100644
--- a/.github/workflows/prod-image-build.yml
+++ b/.github/workflows/prod-image-build.yml
@@ -258,6 +258,9 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' }}"
           breeze release-management generate-constraints --python  "${{ matrix.python-version }}"
           --airflow-constraints-mode constraints --answer yes
           --chicken-egg-providers "${{ inputs.chicken-egg-providers }}"
+        env:
+          # always use UV for constraints generation even if we build `pip` image
+          USE_UV: "true"
         if: inputs.do-build == 'true' && inputs.build-provider-packages != 'true'
       # This cleanup is needed as we will run out of disk space if we keep both CI and PROD images
       # on public runners.
diff --git a/scripts/in_container/run_generate_constraints.py b/scripts/in_container/run_generate_constraints.py
index 0b01d7e05d..766414187d 100755
--- a/scripts/in_container/run_generate_constraints.py
+++ b/scripts/in_container/run_generate_constraints.py
@@ -367,6 +367,7 @@ def generate_constraints_pypi_providers(config_params: ConfigParams) -> None:
                     f"a chicken egg provider"
                 )
                 packages_to_install.append(f"{provider_package} @ file://{file.as_posix()}")
+                break
             else:
                 console.print(
                     f"[yellow]Skipping {provider_package} as it is not found in dist folder to install."