Dev-iL commented on code in PR #74556:
URL: https://github.com/apache/airflow/pull/74556#discussion_r4512702360
##########
scripts/docker/install_airflow_when_building_images.sh:
##########
@@ -33,13 +33,122 @@
# INSTALL_LOCKED_THIRD_PARTY_ONLY - if "true", only the third-party
dependencies locked in uv.lock are installed
# from sources (--no-install-workspace), so
only the pyproject.toml files
# and uv.lock are needed. When a frozen dry
run shows that uv.lock does not
-# match them, or for upgrade builds, nothing
is installed; any other
-# failure fails. The steps that need the
workspace packages are skipped.
+# match them, for upgrade builds, or when
providers are excluded for the
+# image Python version, nothing is
installed; any other failure fails.
+# The steps that need the workspace packages
are skipped.
#
# shellcheck shell=bash disable=SC2086
# shellcheck source=scripts/docker/common.sh
. "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
+function has_providers_excluded_for_python() {
+ local python_minor="${AIRFLOW_PYTHON_VERSION%.*}"
Review Comment:
Done. The helper now evaluates the interpreter running it, which is the
image's own, and both derivations from `AIRFLOW_PYTHON_VERSION` are gone.
<details>
<summary>Explanation</summary>
- The helper defaults to `sys.version_info`.
- The option is now `--python-version`, since `requires-python` is evaluated
against the full release. Only the tests use it.
- The helper logs the version it evaluated and the providers it excluded, so
the build log shows which path was chosen and why.
</details>
<details>
<summary>Tests</summary>
- `test_main_defaults_to_the_running_interpreter` covers the helper default.
- `test_probe_leaves_the_python_version_to_the_interpreter` runs the probe
with the build argument unset, empty, `3.14` and `3.14.2`. It asserts that no
version reaches the helper and that the path chosen doesn't change.
</details>
---
Drafted-by: Claude Code (Opus 5.5); reviewed by @Dev-iL before posting
--
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]