Registry: make tomllib fallback version-aware#66666
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes the tomllib vs tomli import path in the registry extraction scripts deterministic by switching from exception-driven imports to an explicit Python version check (sys.version_info >= (3, 11)), improving readability and consistency across the scripts.
Changes:
- Update
extract_metadata.pyto importsysand use a version-awaretomllib/tomliimport. - Update
extract_versions.pyto use the same version-awaretomllib/tomliimport pattern.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
dev/registry/extract_metadata.py |
Adds sys and switches TOML parsing import logic to a Python-version-based conditional. |
dev/registry/extract_versions.py |
Switches TOML parsing import logic to a Python-version-based conditional. |
Backport failed to create: v3-2-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 5b30aca v3-2-testThis should apply the commit to the v3-2-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
(cherry picked from commit 5b30aca)
Use explicit Python-version check for tomllib fallback in registry extract scripts.
Why:
Changes:
This PR was split from #66250 to keep scope focused.
Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot (GPT-5.3-Codex) following the guidelines
Drafted-by: GitHub Copilot (GPT-5.3-Codex) (no human review before posting)