File tree Expand file tree Collapse file tree 3 files changed +35
-23
lines changed Expand file tree Collapse file tree 3 files changed +35
-23
lines changed Original file line number Diff line number Diff line change @@ -477,6 +477,7 @@ refresh-pipfilelock-files:
477
477
echo "Regenerating requirements.txt files"
478
478
pushd $(ROOT_DIR)
479
479
bash $(ROOT_DIR)/scripts/sync-requirements-txt.sh
480
+ bash $(ROOT_DIR)/scripts/sync-pylock-toml.sh
480
481
popd
481
482
482
483
# This is only for the workflow action
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -Eeuxo pipefail
3
+
4
+ # The following will create a pylock.toml file for every jupyter/ requirements.txt we have.
5
+ uv --version || pip install uv
6
+ cd jupyter
7
+ find . -name " requirements.txt" -type f > files.txt
8
+ cd ..
9
+ while read -r file; do
10
+
11
+ echo " Processing $file "
12
+ path=" ${file# ./* } "
13
+ image_name=" ${path%/*/* } "
14
+ python_version=" ${path%/* } "
15
+ python_version=" ${python_version##* -} "
16
+ image_name=" ${image_name/ +/ -} "
17
+
18
+ if [[ " $path " == * " rocm/" * ]]; then
19
+ image_name=" ${image_name#*/ } -rocm"
20
+ fi
21
+
22
+ # NOTE: --format requirements.txt is useless because of https://github.com/astral-sh/uv/issues/15534
23
+ # uv pip compile --format requirements.txt --python ${python_version} -o jupyter/${path} --generate-hashes --emit-index-url --group jupyter-${image_name}-image --python-platform linux --no-annotate -q
24
+ uv pip compile --format pylock.toml --python " ${python_version} " -o " jupyter/${path% requirements.txt} pylock.toml" --generate-hashes --emit-index-url --group " jupyter-${image_name} -image" --python-platform " linux" --no-annotate -q
25
+
26
+ done < jupyter/files.txt
27
+
28
+ rm jupyter/files.txt
Original file line number Diff line number Diff line change @@ -4,26 +4,9 @@ set -Eeuxo pipefail
4
4
# Our build tooling depends on requirements.txt files with hashes
5
5
# Namely, Konflux (https://konflux-ci.dev/), and Cachi2 (https://github.com/containerbuildsystem/cachi2).
6
6
7
- # The following will create an extra requirement.txt file for every Pipfile.lock we have.
8
- uv --version || pip install uv
9
- cd jupyter
10
- find . -name " requirements.txt" -type f > files.txt
11
- cd ..
12
- while read -r file; do
13
-
14
- echo " Processing $file "
15
- path=" ${file# ./* } "
16
- image_name=" ${path%/*/* } "
17
- python_version=" ${path%/* } "
18
- python_version=" ${python_version##* -} "
19
- image_name=" ${image_name/ +/ -} "
20
-
21
- if [[ " $path " == * " rocm/" * ]]; then
22
- image_name=" ${image_name#*/ } -rocm"
23
- fi
24
-
25
- uv pip compile --format requirements.txt --python ${python_version} -o jupyter/${path} --generate-hashes --group jupyter-${image_name} -image --python-platform linux --no-annotate -q
26
-
27
- done < jupyter/files.txt
28
-
29
- rm jupyter/files.txt
7
+ # The following will create an extra requirements.txt file for every Pipfile.lock we have.
8
+ micropipenv --version || pip install micropipenv
9
+ find . -name Pipfile.lock -execdir bash -c '
10
+ echo "# Generated by /scripts/sync-requirements-txt.sh from Pipfile.lock" > requirements.txt &&
11
+ echo >> requirements.txt &&
12
+ micropipenv requirements >> requirements.txt' \;
You can’t perform that action at this time.
0 commit comments