Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/generate-constraints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ jobs:
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: constraints-${{ matrix.python-version }}
path: ./files/constraints-${{ matrix.python-version }}/constraints-*.txt
path: |
./files/constraints-${{ matrix.python-version }}/constraints-*.txt
./files/constraints-${{ matrix.python-version }}/build-constraints-*.txt
retention-days: 7
if-no-files-found: error
- name: "Dependency upgrade summary"
Expand Down
8 changes: 4 additions & 4 deletions dev/MANUALLY_GENERATING_IMAGE_CACHE_AND_CONSTRAINTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,17 @@ breeze release-management generate-constraints --airflow-constraints-mode constr
AIRFLOW_SOURCES=$(pwd)
```

The constraints will be generated in `files/constraints-PYTHON_VERSION/constraints-*.txt` files. You need to
check out the right 'constraints-' branch in a separate repository, and then you can copy, commit and push the
generated files.
The constraints will be generated in `files/constraints-PYTHON_VERSION/constraints-*.txt` and
`files/constraints-PYTHON_VERSION/build-constraints-*.txt` files. You need to check out the right
'constraints-' branch in a separate repository, and then you can copy, commit and push the generated files.

You need to be a committer, and you have to be authenticated in the apache/airflow repository for your
git commands to be able to push the new constraints

```bash
cd <AIRFLOW_WITH_CONSTRAINTS-MAIN_DIRECTORY>
git pull
cp ${AIRFLOW_SOURCES}/files/constraints-*/constraints*.txt .
cp ${AIRFLOW_SOURCES}/files/constraints-*/{constraints,build-constraints}*.txt .
git diff
git add .
git commit -m "Your commit message here" --no-verify
Expand Down
6 changes: 6 additions & 0 deletions dev/breeze/doc/09_release_management_tasks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,12 @@ Generating constraints
Whenever ``pyproject.toml`` gets modified, the CI main job will re-generate constraint files. Those constraint
files are stored in separated orphan branches: ``constraints-main``, ``constraints-2-0``.

In addition to runtime constraints, the generation also produces **build constraints** files
(``build-constraints-PYTHON_VERSION.txt``). Build constraints pin the versions of build-time dependencies
(e.g. ``setuptools``, ``hatchling``, ``maturin``) for package compilation via build isolation.
These are published alongside runtime constraints on the same branches, but Airflow installation flows do
not consume them yet.

Those are constraint files as described in detail in the
`</contributing-docs/13_airflow_dependencies_and_extras.rst#pinned-constraint-files>`_ contributing documentation.

Expand Down
5 changes: 3 additions & 2 deletions scripts/ci/constraints/ci_commit_constraints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
cd constraints || exit 1
git config --local user.email "dev@airflow.apache.org"
git config --local user.name "Automated GitHub Actions commit"
git diff --color --exit-code --ignore-matching-lines="^#.*" || \
git commit --all --message "Updating constraints. GitHub run id:${GITHUB_RUN_ID}
git add -- 'constraints-*.txt' 'build-constraints-*.txt'
git diff --cached --color --exit-code --ignore-matching-lines="^#.*" || \
git commit --message "Updating constraints. GitHub run id:${GITHUB_RUN_ID}

This update in constraints is automatically committed by the CI 'constraints-push' step based on
'${GITHUB_REF}' in the '${GITHUB_REPOSITORY}' repository with commit sha ${GITHUB_SHA}.
Expand Down
7 changes: 5 additions & 2 deletions scripts/ci/constraints/ci_diff_constraints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
cp -v ./files/constraints-*/constraints*.txt constraints/
cp -v ./files/constraints-*/{constraints,build-constraints}*.txt constraints/
cd constraints || exit 1
git add -- 'constraints-*.txt' 'build-constraints-*.txt'

set +e
git diff --color --exit-code --ignore-matching-lines="^#.*"
git diff --cached --color --exit-code --ignore-matching-lines="^#.*"
diff_status=$?
set -e

git reset HEAD -- . > /dev/null 2>&1

if [[ ${diff_status} -eq 0 ]]; then
echo "No changes in constraints"
elif [[ ${diff_status} -eq 1 ]]; then
Expand Down
Loading
Loading