Skip to content

Commit 2ab820e

Browse files
authored
RHAIENG-304, RHAIENG-786: chore(scripts): update sync-requirements-txt.sh to support pylock.toml generation using uv pip compile instead of Pipfile.lock (opendatahub-io#2220)
1 parent a324e2e commit 2ab820e

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ refresh-pipfilelock-files:
462462

463463
echo "Regenerating requirements.txt files"
464464
pushd $(ROOT_DIR)
465-
bash $(ROOT_DIR)/scripts/sync-requirements-txt.sh
465+
bash $(ROOT_DIR)/scripts/sync-python-lockfiles.sh
466466
popd
467467

468468
# This is only for the workflow action

ci/generate_code.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
set -Eeuxo pipefail
33

44
python3 scripts/dockerfile_fragments.py
5-
bash scripts/sync-requirements-txt.sh
5+
bash scripts/sync-python-lockfiles.sh

scripts/sync-python-lockfiles.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -Eeuxo pipefail
3+
4+
# Red Hat's build tooling depends on requirements.txt files with hashes
5+
# Namely, Konflux (https://konflux-ci.dev/), and Cachi2 (https://github.com/containerbuildsystem/cachi2).
6+
7+
# The following will create a pylock.toml file for every pyproject.toml we have.
8+
uv --version || pip install "uv==0.8.12"
9+
find . -name pylock.toml -execdir bash -c '
10+
pwd
11+
# derives python-version from directory suffix (e.g., "ubi9-python-3.12")
12+
uv pip compile pyproject.toml \
13+
--output-file pylock.toml \
14+
--format pylock.toml \
15+
--generate-hashes \
16+
--emit-index-url \
17+
--python-version="${PWD##*-}" \
18+
--python-platform linux \
19+
--no-annotate \
20+
--quiet' \;

scripts/sync-requirements-txt.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)