This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-3-test by this push:
new 3aa502cf6a2 [v3-3-test] Honour the selected Python version when
building docs (#72689)
3aa502cf6a2 is described below
commit 3aa502cf6a2c289760f08674b6929f06857100f6
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Sep 8 12:14:08 2026 +0200
[v3-3-test] Honour the selected Python version when building docs (#72689)
`breeze build-docs` always used the default Python version, so a docs
build asked to run on a different version silently looked for an image
that was never prepared for it. In the docs publishing workflow, which
builds, stashes and loads a 3.12 CI image, that meant the docs step
discarded it and started a full from-scratch 3.10 image build instead —
wasting the better part of an hour and documenting against a different
interpreter than the workflow intended.
The publish job's own hardcoded Python version was stale for the same
reason and now follows the workflow default like every other job there.
(cherry picked from commit 3261fb43918787fd3d642502b66cb0fc501afcb4)
---
.github/workflows/publish-docs-to-s3.yml | 2 +-
dev/breeze/doc/images/output_build-docs.svg | 44 ++++++++------
dev/breeze/doc/images/output_build-docs.txt | 2 +-
.../airflow_breeze/commands/developer_commands.py | 8 ++-
.../commands/developer_commands_config.py | 1 +
dev/breeze/tests/test_developer_commands.py | 68 ++++++++++++++++++++++
6 files changed, 103 insertions(+), 22 deletions(-)
diff --git a/.github/workflows/publish-docs-to-s3.yml
b/.github/workflows/publish-docs-to-s3.yml
index 6e5f6fc4eba..3192aafbd4f 100644
--- a/.github/workflows/publish-docs-to-s3.yml
+++ b/.github/workflows/publish-docs-to-s3.yml
@@ -416,7 +416,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
INCLUDE_SUCCESS_OUTPUTS: false
- PYTHON_MAJOR_MINOR_VERSION: "3.10"
+ PYTHON_MAJOR_MINOR_VERSION: "${{
needs.build-info.outputs.default-python-version }}"
VERBOSE: "true"
steps:
- name: "Cleanup repo"
diff --git a/dev/breeze/doc/images/output_build-docs.svg
b/dev/breeze/doc/images/output_build-docs.svg
index 172f0f6576e..ba3d9295560 100644
--- a/dev/breeze/doc/images/output_build-docs.svg
+++ b/dev/breeze/doc/images/output_build-docs.svg
@@ -1,4 +1,4 @@
-<svg class="rich-terminal" viewBox="0 0 1482 1538.3999999999999"
xmlns="http://www.w3.org/2000/svg">
+<svg class="rich-terminal" viewBox="0 0 1482 1587.1999999999998"
xmlns="http://www.w3.org/2000/svg">
<!-- Generated with Rich https://www.textualize.io -->
<style>
@@ -43,7 +43,7 @@
<defs>
<clipPath id="breeze-build-docs-clip-terminal">
- <rect x="0" y="0" width="1463.0" height="1487.3999999999999" />
+ <rect x="0" y="0" width="1463.0" height="1536.1999999999998" />
</clipPath>
<clipPath id="breeze-build-docs-line-0">
<rect x="0" y="1.5" width="1464" height="24.65"/>
@@ -225,9 +225,15 @@
<clipPath id="breeze-build-docs-line-59">
<rect x="0" y="1441.1" width="1464" height="24.65"/>
</clipPath>
+<clipPath id="breeze-build-docs-line-60">
+ <rect x="0" y="1465.5" width="1464" height="24.65"/>
+ </clipPath>
+<clipPath id="breeze-build-docs-line-61">
+ <rect x="0" y="1489.9" width="1464" height="24.65"/>
+ </clipPath>
</defs>
- <rect fill="#292929" stroke="rgba(255,255,255,0.35)" stroke-width="1"
x="1" y="1" width="1480" height="1536.4" rx="8"/><text
class="breeze-build-docs-title" fill="#c5c8c6" text-anchor="middle" x="740"
y="27">Command: build-docs</text>
+ <rect fill="#292929" stroke="rgba(255,255,255,0.35)" stroke-width="1"
x="1" y="1" width="1480" height="1585.2" rx="8"/><text
class="breeze-build-docs-title" fill="#c5c8c6" text-anchor="middle" x="740"
y="27">Command: build-docs</text>
<g transform="translate(26,22)">
<circle cx="0" cy="0" r="7" fill="#ff5f57"/>
<circle cx="22" cy="0" r="7" fill="#febc2e"/>
@@ -283,21 +289,23 @@
</text><text class="breeze-build-docs-r5" x="0" y="1069.2" textLength="12.2"
clip-path="url(#breeze-build-docs-line-43)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1069.2" textLength="353.8"
clip-path="url(#breeze-build-docs-line-43)">--include-removed-providers  </text><text
class="breeze-build-docs-r1" x="402.6" y="1069.2" textLength="561.2"
clip-path="url(#breeze-build-docs-line-43)">Whether to include providers that are removed.</te
[...]
</text><text class="breeze-build-docs-r5" x="0" y="1093.6" textLength="1464"
clip-path="url(#breeze-build-docs-line-44)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-build-docs-r1" x="1464" y="1093.6" textLength="12.2"
clip-path="url(#breeze-build-docs-line-44)">
</text><text class="breeze-build-docs-r5" x="0" y="1118" textLength="24.4"
clip-path="url(#breeze-build-docs-line-45)">╭─</text><text
class="breeze-build-docs-r5" x="24.4" y="1118" textLength="170.8"
clip-path="url(#breeze-build-docs-line-45)"> Misc options </text><text
class="breeze-build-docs-r5" x="195.2" y="1118" textLength="1244.4"
clip-path="url(#breeze-build-docs-line-45)">──────────────────────────────────────────────────────────────────────────────────────────────
[...]
-</text><text class="breeze-build-docs-r5" x="0" y="1142.4" textLength="12.2"
clip-path="url(#breeze-build-docs-line-46)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1142.4" textLength="244"
clip-path="url(#breeze-build-docs-line-46)">--include-commits   </text><text
class="breeze-build-docs-r1" x="341.6" y="1142.4" textLength="451.4"
clip-path="url(#breeze-build-docs-line-46)">Include commits in the documentation.</text><text
class="breeze-bu [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1166.8" textLength="12.2"
clip-path="url(#breeze-build-docs-line-47)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1166.8" textLength="244"
clip-path="url(#breeze-build-docs-line-47)">--github-repository </text><text
class="breeze-build-docs-r6" x="292.8" y="1166.8" textLength="24.4"
clip-path="url(#breeze-build-docs-line-47)">-g</text><text
class="breeze-build-docs-r1" x="341.6" y="1166.8" textLength="597.8"
clip-path="ur [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1191.2" textLength="12.2"
clip-path="url(#breeze-build-docs-line-48)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1191.2" textLength="244"
clip-path="url(#breeze-build-docs-line-48)">--builder           </text><text
class="breeze-build-docs-r1" x="341.6" y="1191.2" textLength="768.6"
clip-path="url(#breeze-build-docs-line-48)">Buildx builder used to per
[...]
-</text><text class="breeze-build-docs-r5" x="0" y="1215.6" textLength="12.2"
clip-path="url(#breeze-build-docs-line-49)">│</text><text
class="breeze-build-docs-r7" x="341.6" y="1215.6" textLength="73.2"
clip-path="url(#breeze-build-docs-line-49)">(TEXT)</text><text
class="breeze-build-docs-r5" x="1451.8" y="1215.6" textLength="12.2"
clip-path="url(#breeze-build-docs-line-49)">│</text><text
class="breeze-build-docs-r1" x="1464" y="1215.6" textLength="12.2"
clip-path="url(#breeze-build-doc [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1240" textLength="12.2"
clip-path="url(#breeze-build-docs-line-50)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1240" textLength="244"
clip-path="url(#breeze-build-docs-line-50)">--distributions-list</text><text
class="breeze-build-docs-r1" x="341.6" y="1240" textLength="1098"
clip-path="url(#breeze-build-docs-line-50)">Optional, contains space separated list of package ids that are
[...]
-</text><text class="breeze-build-docs-r5" x="0" y="1264.4" textLength="12.2"
clip-path="url(#breeze-build-docs-line-51)">│</text><text
class="breeze-build-docs-r1" x="341.6" y="1264.4" textLength="1098"
clip-path="url(#breeze-build-docs-line-51)">documentation building, and document publishing. It is an easier alternative to adding    </text><text
class="breeze-build-docs-r5" x="1451.8" y="1264.4" textLength="12.2 [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1288.8" textLength="12.2"
clip-path="url(#breeze-build-docs-line-52)">│</text><text
class="breeze-build-docs-r1" x="341.6" y="1288.8" textLength="1098"
clip-path="url(#breeze-build-docs-line-52)">individual packages as arguments to every command. This overrides the packages passed as  </text><text
class="breeze-build-docs-r5" x="1451.8" y="1288.8" textLength="12.2" cli [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1313.2" textLength="12.2"
clip-path="url(#breeze-build-docs-line-53)">│</text><text
class="breeze-build-docs-r1" x="341.6" y="1313.2" textLength="134.2"
clip-path="url(#breeze-build-docs-line-53)">arguments. </text><text
class="breeze-build-docs-r7" x="475.8" y="1313.2" textLength="73.2"
clip-path="url(#breeze-build-docs-line-53)">(TEXT)</text><text
class="breeze-build-docs-r5" x="1451.8" y="1313.2" textLength="12.2"
clip-path="url( [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1337.6" textLength="1464"
clip-path="url(#breeze-build-docs-line-54)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-build-docs-r1" x="1464" y="1337.6" textLength="12.2"
clip-path="url(#breeze-build-docs-line-54)">
-</text><text class="breeze-build-docs-r5" x="0" y="1362" textLength="24.4"
clip-path="url(#breeze-build-docs-line-55)">╭─</text><text
class="breeze-build-docs-r5" x="24.4" y="1362" textLength="195.2"
clip-path="url(#breeze-build-docs-line-55)"> Common options </text><text
class="breeze-build-docs-r5" x="219.6" y="1362" textLength="1220"
clip-path="url(#breeze-build-docs-line-55)">──────────────────────────────────────────────────────────────────────────────────────────────
[...]
-</text><text class="breeze-build-docs-r5" x="0" y="1386.4" textLength="12.2"
clip-path="url(#breeze-build-docs-line-56)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1386.4" textLength="109.8"
clip-path="url(#breeze-build-docs-line-56)">--dry-run</text><text
class="breeze-build-docs-r6" x="158.6" y="1386.4" textLength="24.4"
clip-path="url(#breeze-build-docs-line-56)">-D</text><text
class="breeze-build-docs-r1" x="207.4" y="1386.4" textLength="719.8"
clip-path="url(#breeze-buil [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1410.8" textLength="12.2"
clip-path="url(#breeze-build-docs-line-57)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1410.8" textLength="109.8"
clip-path="url(#breeze-build-docs-line-57)">--verbose</text><text
class="breeze-build-docs-r6" x="158.6" y="1410.8" textLength="24.4"
clip-path="url(#breeze-build-docs-line-57)">-v</text><text
class="breeze-build-docs-r1" x="207.4" y="1410.8" textLength="585.6"
clip-path="url(#breeze-buil [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1435.2" textLength="12.2"
clip-path="url(#breeze-build-docs-line-58)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1435.2" textLength="109.8"
clip-path="url(#breeze-build-docs-line-58)">--answer </text><text
class="breeze-build-docs-r6" x="158.6" y="1435.2" textLength="24.4"
clip-path="url(#breeze-build-docs-line-58)">-a</text><text
class="breeze-build-docs-r1" x="207.4" y="1435.2" textLength="329.4"
clip-path="url(#breeze [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1459.6" textLength="12.2"
clip-path="url(#breeze-build-docs-line-59)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1459.6" textLength="109.8"
clip-path="url(#breeze-build-docs-line-59)">--help   </text><text
class="breeze-build-docs-r6" x="158.6" y="1459.6" textLength="24.4"
clip-path="url(#breeze-build-docs-line-59)">-h</text><text
class="breeze-build-docs-r1" x="207.4" y="1459.6" textLength="329.4"
clip-path="u [...]
-</text><text class="breeze-build-docs-r5" x="0" y="1484" textLength="1464"
clip-path="url(#breeze-build-docs-line-60)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-build-docs-r1" x="1464" y="1484" textLength="12.2"
clip-path="url(#breeze-build-docs-line-60)">
+</text><text class="breeze-build-docs-r5" x="0" y="1142.4" textLength="12.2"
clip-path="url(#breeze-build-docs-line-46)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1142.4" textLength="244"
clip-path="url(#breeze-build-docs-line-46)">--python            </text><text
class="breeze-build-docs-r6" x="292.8" y="1142.4" textLength="24.4"
clip-path="url(#breeze-build-docs-line-46)">-p</text><text
class="breeze-build-docs-r1 [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1166.8" textLength="12.2"
clip-path="url(#breeze-build-docs-line-47)">│</text><text
class="breeze-build-docs-r7" x="341.6" y="1166.8" textLength="317.2"
clip-path="url(#breeze-build-docs-line-47)">3.11 | 3.12 | 3.13 | 3.14)</text><text
class="breeze-build-docs-r5" x="1451.8" y="1166.8" textLength="12.2"
clip-path="url(#breeze-build-docs-line-47)">│</text><text
class="breeze-build-docs-r1" x="1464" y="1166.8" [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1191.2" textLength="12.2"
clip-path="url(#breeze-build-docs-line-48)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1191.2" textLength="244"
clip-path="url(#breeze-build-docs-line-48)">--include-commits   </text><text
class="breeze-build-docs-r1" x="341.6" y="1191.2" textLength="451.4"
clip-path="url(#breeze-build-docs-line-48)">Include commits in the documentation.</text><text
class="breeze-bu [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1215.6" textLength="12.2"
clip-path="url(#breeze-build-docs-line-49)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1215.6" textLength="244"
clip-path="url(#breeze-build-docs-line-49)">--github-repository </text><text
class="breeze-build-docs-r6" x="292.8" y="1215.6" textLength="24.4"
clip-path="url(#breeze-build-docs-line-49)">-g</text><text
class="breeze-build-docs-r1" x="341.6" y="1215.6" textLength="597.8"
clip-path="ur [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1240" textLength="12.2"
clip-path="url(#breeze-build-docs-line-50)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1240" textLength="244"
clip-path="url(#breeze-build-docs-line-50)">--builder           </text><text
class="breeze-build-docs-r1" x="341.6" y="1240" textLength="768.6"
clip-path="url(#breeze-build-docs-line-50)">Buildx builder used to perform&#
[...]
+</text><text class="breeze-build-docs-r5" x="0" y="1264.4" textLength="12.2"
clip-path="url(#breeze-build-docs-line-51)">│</text><text
class="breeze-build-docs-r7" x="341.6" y="1264.4" textLength="73.2"
clip-path="url(#breeze-build-docs-line-51)">(TEXT)</text><text
class="breeze-build-docs-r5" x="1451.8" y="1264.4" textLength="12.2"
clip-path="url(#breeze-build-docs-line-51)">│</text><text
class="breeze-build-docs-r1" x="1464" y="1264.4" textLength="12.2"
clip-path="url(#breeze-build-doc [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1288.8" textLength="12.2"
clip-path="url(#breeze-build-docs-line-52)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1288.8" textLength="244"
clip-path="url(#breeze-build-docs-line-52)">--distributions-list</text><text
class="breeze-build-docs-r1" x="341.6" y="1288.8" textLength="1098"
clip-path="url(#breeze-build-docs-line-52)">Optional, contains space separated list of package ids that
[...]
+</text><text class="breeze-build-docs-r5" x="0" y="1313.2" textLength="12.2"
clip-path="url(#breeze-build-docs-line-53)">│</text><text
class="breeze-build-docs-r1" x="341.6" y="1313.2" textLength="1098"
clip-path="url(#breeze-build-docs-line-53)">documentation building, and document publishing. It is an easier alternative to adding    </text><text
class="breeze-build-docs-r5" x="1451.8" y="1313.2" textLength="12.2 [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1337.6" textLength="12.2"
clip-path="url(#breeze-build-docs-line-54)">│</text><text
class="breeze-build-docs-r1" x="341.6" y="1337.6" textLength="1098"
clip-path="url(#breeze-build-docs-line-54)">individual packages as arguments to every command. This overrides the packages passed as  </text><text
class="breeze-build-docs-r5" x="1451.8" y="1337.6" textLength="12.2" cli [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1362" textLength="12.2"
clip-path="url(#breeze-build-docs-line-55)">│</text><text
class="breeze-build-docs-r1" x="341.6" y="1362" textLength="134.2"
clip-path="url(#breeze-build-docs-line-55)">arguments. </text><text
class="breeze-build-docs-r7" x="475.8" y="1362" textLength="73.2"
clip-path="url(#breeze-build-docs-line-55)">(TEXT)</text><text
class="breeze-build-docs-r5" x="1451.8" y="1362" textLength="12.2"
clip-path="url(#breeze- [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1386.4" textLength="1464"
clip-path="url(#breeze-build-docs-line-56)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-build-docs-r1" x="1464" y="1386.4" textLength="12.2"
clip-path="url(#breeze-build-docs-line-56)">
+</text><text class="breeze-build-docs-r5" x="0" y="1410.8" textLength="24.4"
clip-path="url(#breeze-build-docs-line-57)">╭─</text><text
class="breeze-build-docs-r5" x="24.4" y="1410.8" textLength="195.2"
clip-path="url(#breeze-build-docs-line-57)"> Common options </text><text
class="breeze-build-docs-r5" x="219.6" y="1410.8" textLength="1220"
clip-path="url(#breeze-build-docs-line-57)">────────────────────────────────────────────────────────────────────────────────────────
[...]
+</text><text class="breeze-build-docs-r5" x="0" y="1435.2" textLength="12.2"
clip-path="url(#breeze-build-docs-line-58)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1435.2" textLength="109.8"
clip-path="url(#breeze-build-docs-line-58)">--dry-run</text><text
class="breeze-build-docs-r6" x="158.6" y="1435.2" textLength="24.4"
clip-path="url(#breeze-build-docs-line-58)">-D</text><text
class="breeze-build-docs-r1" x="207.4" y="1435.2" textLength="719.8"
clip-path="url(#breeze-buil [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1459.6" textLength="12.2"
clip-path="url(#breeze-build-docs-line-59)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1459.6" textLength="109.8"
clip-path="url(#breeze-build-docs-line-59)">--verbose</text><text
class="breeze-build-docs-r6" x="158.6" y="1459.6" textLength="24.4"
clip-path="url(#breeze-build-docs-line-59)">-v</text><text
class="breeze-build-docs-r1" x="207.4" y="1459.6" textLength="585.6"
clip-path="url(#breeze-buil [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1484" textLength="12.2"
clip-path="url(#breeze-build-docs-line-60)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1484" textLength="109.8"
clip-path="url(#breeze-build-docs-line-60)">--answer </text><text
class="breeze-build-docs-r6" x="158.6" y="1484" textLength="24.4"
clip-path="url(#breeze-build-docs-line-60)">-a</text><text
class="breeze-build-docs-r1" x="207.4" y="1484" textLength="329.4"
clip-path="url(#breeze-build-d [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1508.4" textLength="12.2"
clip-path="url(#breeze-build-docs-line-61)">│</text><text
class="breeze-build-docs-r4" x="24.4" y="1508.4" textLength="109.8"
clip-path="url(#breeze-build-docs-line-61)">--help   </text><text
class="breeze-build-docs-r6" x="158.6" y="1508.4" textLength="24.4"
clip-path="url(#breeze-build-docs-line-61)">-h</text><text
class="breeze-build-docs-r1" x="207.4" y="1508.4" textLength="329.4"
clip-path="u [...]
+</text><text class="breeze-build-docs-r5" x="0" y="1532.8" textLength="1464"
clip-path="url(#breeze-build-docs-line-62)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-build-docs-r1" x="1464" y="1532.8" textLength="12.2"
clip-path="url(#breeze-build-docs-line-62)">
</text>
</g>
</g>
diff --git a/dev/breeze/doc/images/output_build-docs.txt
b/dev/breeze/doc/images/output_build-docs.txt
index 16f4bb39a00..b5fd49b382b 100644
--- a/dev/breeze/doc/images/output_build-docs.txt
+++ b/dev/breeze/doc/images/output_build-docs.txt
@@ -1 +1 @@
-7cefd2a8c0346a060a6f76fa60f9ed3a
+f78851cc65cd841293f0487b803d51a8
diff --git a/dev/breeze/src/airflow_breeze/commands/developer_commands.py
b/dev/breeze/src/airflow_breeze/commands/developer_commands.py
index 4c53d752236..a879e1066bf 100644
--- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py
@@ -822,6 +822,7 @@ def _build_python_docs(
*,
generated_path: Path,
builder: str,
+ python: str,
clean_build: bool,
clean_inventory_cache: bool,
refresh_airflow_inventories: bool,
@@ -839,7 +840,7 @@ def _build_python_docs(
):
build_params = BuildCiParams(
github_repository=github_repository,
- python=DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
+ python=python,
builder=builder,
)
rebuild_or_pull_ci_image_if_needed(command_params=build_params)
@@ -894,7 +895,7 @@ def _build_python_docs(
)
shell_params = ShellParams(
github_repository=github_repository,
- python=DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
+ python=python,
mount_sources=MOUNT_ALL,
)
result = execute_command_in_shell(shell_params,
project_name="breeze-docs", command=cmd)
@@ -941,6 +942,7 @@ def _build_python_docs(
@option_github_repository
@option_include_not_ready_providers
@option_include_removed_providers
+@option_python
@click.option(
"--one-pass-only",
help="Builds documentation in one pass only. This is useful for debugging
sphinx errors.",
@@ -985,6 +987,7 @@ def build_docs(
include_commits: bool,
one_pass_only: bool,
package_filter: tuple[str, ...],
+ python: str,
distributions_list: str,
spellcheck_only: bool,
sdk: tuple[str, ...],
@@ -1015,6 +1018,7 @@ def build_docs(
include_commits=include_commits,
one_pass_only=one_pass_only,
package_filter=package_filter,
+ python=python,
distributions_list=distributions_list,
spellcheck_only=spellcheck_only,
doc_packages=doc_packages,
diff --git
a/dev/breeze/src/airflow_breeze/commands/developer_commands_config.py
b/dev/breeze/src/airflow_breeze/commands/developer_commands_config.py
index 17d32146110..f3816139abe 100644
--- a/dev/breeze/src/airflow_breeze/commands/developer_commands_config.py
+++ b/dev/breeze/src/airflow_breeze/commands/developer_commands_config.py
@@ -385,6 +385,7 @@ DEVELOPER_PARAMETERS: dict[str, list[dict[str, str |
list[str]]]] = {
{
"name": "Misc options",
"options": [
+ "--python",
"--include-commits",
"--github-repository",
"--builder",
diff --git a/dev/breeze/tests/test_developer_commands.py
b/dev/breeze/tests/test_developer_commands.py
new file mode 100644
index 00000000000..d5b0ca1a070
--- /dev/null
+++ b/dev/breeze/tests/test_developer_commands.py
@@ -0,0 +1,68 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+from unittest.mock import patch
+
+import pytest
+from click.testing import CliRunner
+
+from airflow_breeze.commands.developer_commands import build_docs
+
+
[email protected]
+def runner():
+ return CliRunner()
+
+
+class TestBuildDocsPythonVersion:
+ """`breeze build-docs` must document with the Python version it was asked
for."""
+
+ @pytest.fixture(autouse=True)
+ def _no_docker(self, monkeypatch):
+ monkeypatch.setenv("SKIP_SAVING_CHOICES", "true")
+ for name in (
+ "perform_environment_checks",
+ "fix_ownership_using_docker",
+ "cleanup_python_generated_files",
+ ):
+
monkeypatch.setattr(f"airflow_breeze.commands.developer_commands.{name}",
lambda *a, **kw: None)
+
+ def _invoke(self, runner: CliRunner, args: list[str], env: dict[str, str]
| None = None):
+ with (
+ patch(
+
"airflow_breeze.commands.developer_commands.rebuild_or_pull_ci_image_if_needed"
+ ) as mock_rebuild,
+
patch("airflow_breeze.commands.developer_commands.execute_command_in_shell") as
mock_shell,
+ ):
+ mock_shell.return_value.returncode = 0
+ runner.invoke(build_docs, args, env=env, catch_exceptions=False)
+ return mock_rebuild, mock_shell
+
+ @pytest.mark.parametrize(
+ ("args", "env"),
+ [
+ pytest.param(["--python", "3.12"], None, id="python-option"),
+ pytest.param([], {"PYTHON_MAJOR_MINOR_VERSION": "3.12"},
id="python-env-var"),
+ ],
+ )
+ def test_selected_python_is_used_for_image_and_shell(self, runner, args,
env):
+ mock_rebuild, mock_shell = self._invoke(runner, [*args,
"--docs-only"], env=env)
+
+ assert mock_rebuild.call_args.kwargs["command_params"].python == "3.12"
+ assert mock_shell.call_args.args[0].python == "3.12"