Add --build-constraint(s) flag support to constraints pipeline#65511
Open
nailo2c wants to merge 5 commits intoapache:mainfrom
Open
Add --build-constraint(s) flag support to constraints pipeline#65511nailo2c wants to merge 5 commits intoapache:mainfrom
--build-constraint(s) flag support to constraints pipeline#65511nailo2c wants to merge 5 commits intoapache:mainfrom
Conversation
60c5099 to
ff23dab
Compare
ff23dab to
0cea6f0
Compare
0cea6f0 to
9b28df3
Compare
9b28df3 to
80789d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #54394
Hi folks, I know this is a big PR. I'll try my best to explain it concise and clear.
Summary
Add build constraints support to Airflow's constraints pipeline.
Airflow now generates and publishes
build-constraints-{python}.txtnext to the existing runtime constraints, and install flows pass them touv pip install --build-constraintsorpip install --build-constraintwhen available.How it works
flowchart LR A["Existing inputs:<br/>uv.lock + workspace pyproject.toml"] B["Existing runtime constraints"] C["Existing constraints branch"] D["Existing install commands (uv pip install / pip install)"] X["NEW build constraints generation"] Y["NEW build-constraints-3.x.txt"] Z["NEW --build-constraints flags"] A --> B --> C --> D A --> X --> Y --> C C --> Z --> D classDef existing fill:#ffffff,stroke:#777777,color:#111111; classDef added fill:#e7f5ff,stroke:#1971c2,stroke-width:2px,color:#111111; class A,B,C,D existing; class X,Y,Z added;Key design decisions:
Build constraints are a single file per Python version, shared across all 3 constraint modes.
uv syncpaths are excluded becauseuv syncdoes not support--build-constraints.Fallback no-constraints paths never include build constraints, matching runtime constraints behavior.
Auto-inferred missing build constraints are skipped for backward compatibility with old constraint branches
Explicit
AIRFLOW_BUILD_CONSTRAINTS_LOCATIONvalues fail fast if the file or URL is missing.The generator targets build requirements relevant to Airflow's default wheel-preferred install path, rather than forcing source-build coverage for every locked package.
Source-scan scope validation
A separate full-scan script scans all ~749 packages with sdist URLs (no wheel filtering, no cache). Running both against the same
uv.lock:All 37 extra deps come from packages with universal wheels. Under the default wheel-preferred install path, those packages are not expected to enter build isolation, so the production scanner covers the build deps relevant to normal Airflow installs while keeping generation fast.
Review guide
Suggested review order follows the data flow:
scripts/in_container/install_airflow_and_providers.py
scripts/in_container/install_development_dependencies.py
scripts/ci/constraints/*.sh
MANUALLY_GENERATING_IMAGE_CACHE_AND_CONSTRAINTS.md
09_release_management_tasks.rst
Generated/synced files:
prek update-inlined-dockerfile-scripts --all-files.Verification
pyproject.tomlfiles, and uv conflict diagnostic wording.build-constraints-*.txtfor all three constraints modes.Generation: workspace scan, upstream scan, and constraint resolution
Integration: 3 constraint modes all produce build-constraints-*.txt
Negative & positive tests: build constraints actually block/allow installation
CI Results
We can find the build constraints related log in this PR's CI run.
Was generative AI tooling used to co-author this PR?
Claude Opus 4.6 + Codex 5.4
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.