File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ on: # yamllint disable-line rule:truthy
2323 - ' ["3.11"]'
2424 - ' ["3.9"]'
2525 - ' ["3.8"]'
26+ lockfiles_upgrade :
27+ description : ' Force full relock and upgrades for pylock.toml (manual runs)'
28+ required : false
29+ default : ' false'
30+ type : choice
31+ options :
32+ - ' true'
33+ - ' false'
2634 update_optional_dirs :
2735 description : ' Include optional directories in update'
2836 required : false
4856 env :
4957 BRANCH : ${{ github.event.inputs.branch || 'main' }}
5058 INCLUDE_OPT_DIRS : ${{ github.event.inputs.update_optional_dirs || 'false' }}
59+ # Force full relock on scheduled runs. For manual runs, use the input toggle.
60+ FORCE_LOCKFILES_UPGRADE : ${{ github.event_name == 'schedule' && '1' || (github.event.inputs.lockfiles_upgrade == 'true' && '1' || '0') }}
5161
5262 steps :
5363 - name : Checkout code
7585 - name : Run make refresh-pipfilelock-files
7686 run : |
7787 make refresh-pipfilelock-files PYTHON_VERSION=${{ matrix.python-version }} INCLUDE_OPT_DIRS=${{ env.INCLUDE_OPT_DIRS }}
88+ env :
89+ FORCE_LOCKFILES_UPGRADE : ${{ env.FORCE_LOCKFILES_UPGRADE }}
7890
7991 - name : Commit changes (if any)
8092 run : |
Original file line number Diff line number Diff line change @@ -4,6 +4,25 @@ set -Eeuxo pipefail
44# Red Hat's build tooling depends on requirements.txt files with hashes
55# Namely, Konflux (https://konflux-ci.dev/), and Cachi2 (https://github.com/containerbuildsystem/cachi2).
66
7+ # Optional behavior:
8+ # - If FORCE_LOCKFILES_UPGRADE=1 (env) or --upgrade (arg) is provided, perform a
9+ # ground-up relock and force upgrades using `uv pip compile --upgrade`.
10+ # This is intended for scheduled runs, while manual runs should default to off.
11+
12+ ADDITIONAL_UV_FLAGS=" "
13+ for arg in " $@ " ; do
14+ case " $arg " in
15+ --upgrade)
16+ FORCE_LOCKFILES_UPGRADE=1
17+ ;;
18+ esac
19+ done
20+
21+ if [[ " ${FORCE_LOCKFILES_UPGRADE:- 0} " == " 1" ]]; then
22+ ADDITIONAL_UV_FLAGS=" --upgrade"
23+ fi
24+ export ADDITIONAL_UV_FLAGS
25+
726# The following will create a pylock.toml file for every pyproject.toml we have.
827uv --version || pip install " uv==0.8.12"
928find . -name pylock.toml -execdir bash -c '
@@ -17,4 +36,5 @@ find . -name pylock.toml -execdir bash -c '
1736 --python-version="${PWD##*-}" \
1837 --python-platform linux \
1938 --no-annotate \
39+ ${ADDITIONAL_UV_FLAGS:-} \
2040 --quiet' \;
Original file line number Diff line number Diff line change 1414
1515if TYPE_CHECKING :
1616 from typing import Any
17+
1718 import pytest_subtests
1819
1920MAKE = shutil .which ("gmake" ) or shutil .which ("make" )
You can’t perform that action at this time.
0 commit comments