Dev-iL commented on code in PR #74556:
URL: https://github.com/apache/airflow/pull/74556#discussion_r4512714251
##########
scripts/ci/prek/update_airflow_pyproject_toml.py:
##########
@@ -286,8 +286,10 @@ def get_exclusion_marker(provider_dependencies: dict[str,
Any]) -> str:
f'"{provider_id}" = [\n
"{distribution_name}>={min_provider_version}{exclusion_marker}"{comment}\n]\n'
)
else:
- all_optional_dependencies.append(f'"{provider_id}" = [\n
"{distribution_name}"\n]\n')
- all_provider_lines.append(f' "{distribution_name}",\n')
+ all_optional_dependencies.append(
+ f'"{provider_id}" = [\n
"{distribution_name}{exclusion_marker}"\n]\n'
Review Comment:
Added. The new test builds the dependency entries for a provider that
excludes 3.15 and has no minimum version, and checks that the marker rejects
3.15 and accepts 3.14.
To make it testable, the per-provider extra and the `all` line moved out of
the `__main__` block into `build_provider_dependency_entries`. Rerunning
`update-pyproject-toml` leaves `pyproject.toml` unchanged.
`test_build_provider_dependency_entries_marks_a_provider_without_a_minimum_version`
builds both entries for a provider with `excluded-python-versions: ["3.15"]`
and no minimum version. Each entry is parsed as TOML and as a requirement, and
the test asserts that the marker rejects 3.15 and accepts 3.14. Dropping the
marker from the no-minimum branch fails the test.
---
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]