File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,22 @@ set -Eeuxo pipefail
7
7
# The following will create an extra requirement.txt file for every Pipfile.lock we have.
8
8
uv --version || pip install uv
9
9
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
12
13
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##* -} "
15
19
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"
21
22
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
22
27
23
- uv export --format requirements-txt --group jupyter-${image_name}-image >> requirements .txt' \;
28
+ rm jupyter/files .txt
You can’t perform that action at this time.
0 commit comments