File tree Expand file tree Collapse file tree
buildpacks/python-dependency-manager/bin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,32 @@ if python -c "import ipykernel" >/dev/null 2>&1;then
3030fi
3131EOL
3232
33+ if (which uv); then
34+ uv_cache_dir=" ${CNB_LAYERS_DIR} /uv_cache"
35+ ls -la /layers
36+ cat /layers/* .toml
37+ uv_cache_layer=" /layers/paketo-buildpacks_python-package-managers-run/uv-env-cache"
38+ cp -r " ${uv_cache_layer} " " $uv_cache_dir "
39+ chmod -R go+w " ${uv_cache_dir} "
40+ cat >> " ${execd_dir} " /setup.sh << EOL
41+ cp -ras --update=none "${uv_cache_dir} " "\$ {RENKU_MOUNT_DIR}/.uv_cache"
42+ export UV_CACHE_DIR="\$ {RENKU_MOUNT_DIR}/.uv_cache"
43+ if !(grep "UV_CACHE_DIR" \$ {HOME}/.bashrc); then
44+ printf "export UV_CACHE_DIR=\$ {RENKU_MOUNT_DIR}/.uv_cache\n" >> \$ {HOME}/.bashrc
45+ fi
46+ EOL
47+
48+ cat > " ${uv_cache_dir} .toml" << EOL
49+ [types]
50+ launch = true
51+
52+ [metadata]
53+ description = "set uv cache for in session use"
54+ version = "0.0.6"
55+ EOL
56+ fi
57+
58+
3359chmod +x " ${execd_dir} " /setup.sh
3460
3561echo " Added launch script to ${execd_dir} /setup.sh"
@@ -42,3 +68,6 @@ launch = true
4268description = "set dependency management for run sessions"
4369version = "0.0.6"
4470EOL
71+
72+ ls -la " ${CNB_LAYERS_DIR} "
73+ cat " ${CNB_LAYERS_DIR} " /* toml
Original file line number Diff line number Diff line change @@ -35,9 +35,14 @@ launch = true
3535
3636[[or]]
3737[[or.requires]]
38- name = "uv"
38+ name = "uv-environment "
3939
4040[or.requires.metadata]
4141launch = true
4242
43+ [[or.requires]]
44+ name = "uv"
45+
46+ [or.requires.metadata]
47+ launch = true
4348EOL
You can’t perform that action at this time.
0 commit comments