Skip to content

Commit 1d56a03

Browse files
committed
Change the sync-requirements-txt.sh so that it uses uv pip compile instead of uv export
1 parent af90f1f commit 1d56a03

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

scripts/sync-requirements-txt.sh

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@ set -Eeuxo pipefail
77
# The following will create an extra requirement.txt file for every Pipfile.lock we have.
88
uv --version || pip install uv
99
cd jupyter
10-
find . -name requirements.txt -execdir bash -c '
11-
full_path=$(pwd)
10+
find . -name "requirements.txt" -type f > files.txt
11+
cd ..
12+
while read -r file; do
1213

13-
echo "# Generated by /scripts/sync-requirements-txt.sh from uv.lock" > requirements.txt
14-
echo >> requirements.txt
14+
echo "Processing $file"
15+
path="${file#./*}"
16+
image_name="${path%/*/*}"
17+
python_version="${path%/*}"
18+
python_version="${python_version##*-}"
1519

16-
temp_dir="${full_path%/*}"
17-
image_name="${temp_dir##*/}"
18-
19-
if [[ "$full_path" == *"/rocm/"* ]]; then
20-
image_name="${image_name}-rocm"
20+
if [[ "$path" == *"rocm/"* ]]; then
21+
image_name="${image_name#*/}-rocm"
2122
fi
23+
24+
uv pip compile --format requirements.txt --python ${python_version} -o jupyter/${path} --generate-hashes --group jupyter-${image_name}-image --universal -q
25+
26+
done < jupyter/files.txt
2227

23-
uv export --format requirements-txt --group jupyter-${image_name}-image >> requirements.txt' \;
28+
rm jupyter/files.txt

0 commit comments

Comments
 (0)