Dev-iL commented on code in PR #74556:
URL: https://github.com/apache/airflow/pull/74556#discussion_r4308437454


##########
scripts/docker/install_airflow_when_building_images.sh:
##########
@@ -35,6 +35,104 @@
 # shellcheck source=scripts/docker/common.sh
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
+function has_providers_excluded_for_python() {
+    local python_minor="${AIRFLOW_PYTHON_VERSION%.*}"
+    PYTHONPATH="$( dirname "${BASH_SOURCE[0]}" )" python3 -c \
+        'from pathlib import Path; import sys; from filter_ci_install_set 
import split_members; sys.exit(not split_members(Path.cwd(), sys.argv[1])[1])' \
+        "${python_minor}"
+}
+
+# uv sync --all-packages installs every workspace member, including providers 
excluded for this
+# Python minor and the third-party packages only they need. Resolve the 
members that are not excluded
+# for this interpreter, with the lock's pins as constraints, and install 
exactly that result.
+# Resolves the lock into the install set for this interpreter. This is the 
only step that can fail
+# recoverably - a dependency missing from uv.lock stops the helper - so the 
caller tests it, and that
+# suppresses errexit here: each command has to report its own failure.
+function prepare_filtered_install_set() {
+    local status
+    # Two exports of the same lock: the plain one is the resolver's 
constraints file (uv rejects hashes
+    # there), the hashed one supplies the --hash options that keep `uv sync 
--frozen`'s sha256 check.
+    uv export --frozen --all-packages --group ci-image --no-hashes 
--no-emit-workspace \
+        --output-file "${work_dir}/pins.txt" || { status=$?; set +x; return 
"${status}"; }
+    uv export --frozen --all-packages --group ci-image --no-emit-workspace \
+        --output-file "${work_dir}/hashed-pins.txt" || { status=$?; set +x; 
return "${status}"; }

Review Comment:
   Replaced by a single `uv export` that already carries the hashes, with each 
member's `pyproject.toml` now read once and only for its name.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to