Re: [PR] Sync default image Python version references [airflow]
boring-cyborg[bot] commented on PR #64994: URL: https://github.com/apache/airflow/pull/64994#issuecomment-4229163220 Awesome work, congrats on your first merged pull request! You are invited to check our [Issue Tracker](https://github.com/apache/airflow/issues) for additional contributions. -- 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]
Re: [PR] Sync default image Python version references [airflow]
github-actions[bot] commented on PR #64994: URL: https://github.com/apache/airflow/pull/64994#issuecomment-4229164724 ### Backport successfully created: v3-2-test Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x) the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches. In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel. Status Branch Result ✅ v3-2-test https://github.com/apache/airflow/pull/65045";>https://img.shields.io/badge/PR-65045-blue"; alt="PR Link"> -- 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]
Re: [PR] Sync default image Python version references [airflow]
jscheffl merged PR #64994: URL: https://github.com/apache/airflow/pull/64994 -- 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]
Re: [PR] Sync default image Python version references [airflow]
jscheffl commented on PR #64994: URL: https://github.com/apache/airflow/pull/64994#issuecomment-4229163085 Cool! LGTM! -- 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]
Re: [PR] Sync default image Python version references [airflow]
Copilot commented on code in PR #64994:
URL: https://github.com/apache/airflow/pull/64994#discussion_r3066480947
##
scripts/ci/prek/common_prek_utils.py:
##
@@ -118,19 +119,29 @@ def read_airflow_version() -> str:
)
+def _read_global_constants_assignment(name: str) -> Any:
+"""Read a top-level assignment from global_constants.py."""
+tree = ast.parse(GLOBAL_CONSTANTS_PATH.read_text())
+for node in tree.body:
+if isinstance(node, ast.Assign):
+for target in node.targets:
+if isinstance(target, ast.Name) and target.id == name:
+return ast.literal_eval(node.value)
+raise RuntimeError(f"{name} not found in global_constants.py")
+
+
def read_allowed_kubernetes_versions() -> list[str]:
"""Parse ALLOWED_KUBERNETES_VERSIONS from global_constants.py (single
source of truth).
Returns versions without the ``v`` prefix, e.g. ``["1.30.13", "1.31.12",
...]``.
"""
-tree = ast.parse(GLOBAL_CONSTANTS_PATH.read_text())
-for node in tree.body:
-if isinstance(node, ast.Assign):
-for target in node.targets:
-if isinstance(target, ast.Name) and target.id ==
"ALLOWED_KUBERNETES_VERSIONS":
-versions: list[str] = ast.literal_eval(node.value)
-return [v.lstrip("v") for v in versions]
-raise RuntimeError("ALLOWED_KUBERNETES_VERSIONS not found in
global_constants.py")
+versions: list[str] =
_read_global_constants_assignment("ALLOWED_KUBERNETES_VERSIONS")
+return [v.lstrip("v") for v in versions]
+
+
+def read_default_python_major_minor_version_for_images() -> str:
+"""Parse DEFAULT_PYTHON_MAJOR_MINOR_VERSION_FOR_IMAGES from
global_constants.py."""
+return
_read_global_constants_assignment("DEFAULT_PYTHON_MAJOR_MINOR_VERSION_FOR_IMAGES")
Review Comment:
`read_default_python_major_minor_version_for_images()` is annotated to
return `str`, but it returns the `Any` result of
`_read_global_constants_assignment(...)` without validating/casting. Consider
validating the parsed value is a string (and raising a clear error otherwise)
to make failures more obvious if `global_constants.py` changes.
```suggestion
value =
_read_global_constants_assignment("DEFAULT_PYTHON_MAJOR_MINOR_VERSION_FOR_IMAGES")
if not isinstance(value, str):
raise RuntimeError(
"DEFAULT_PYTHON_MAJOR_MINOR_VERSION_FOR_IMAGES in
global_constants.py "
f"must be a string, got {type(value).__name__}"
)
return value
```
--
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]
Re: [PR] Sync default image Python version references [airflow]
DaveT1991 commented on PR #64994: URL: https://github.com/apache/airflow/pull/64994#issuecomment-4224032263 > NICE! Anytime! -- 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]
Re: [PR] Sync default image Python version references [airflow]
potiuk commented on PR #64994: URL: https://github.com/apache/airflow/pull/64994#issuecomment-453722 NICE! -- 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]
[PR] Sync default image Python version references [airflow]
DaveT1991 opened a new pull request, #64994: URL: https://github.com/apache/airflow/pull/64994 ## Summary Sync the default Docker image Python version references with Breeze's single source of truth. `dev/breeze/src/airflow_breeze/global_constants.py` already sets `DEFAULT_PYTHON_MAJOR_MINOR_VERSION_FOR_IMAGES` to `3.13`, but `scripts/ci/prek/upgrade_important_versions.py` still hardcoded `3.12`. Because of that drift, the checked-in Dockerfile and related docs/examples still referenced `3.12.13` as the default image Python version. This change: - updates the checked-in default image Python references to `3.13.13` - makes `upgrade_important_versions.py` read the default image Python version from `global_constants.py` through `common_prek_utils.py` - adds unit coverage for the new helper Closes #64977 ## Testing - Added tests in `scripts/tests/ci/prek/test_common_prek_utils.py` - `git diff --check` I could not run the Python test suite locally in this environment because `python`/`uv` are not installed here. -- 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]
