Compare commits

..

10 commits

Author SHA1 Message Date
f64ebcd0f1
fix 2024-09-29 20:53:02 +02:00
23e3475c91
venvs/relate 2024-09-29 20:49:09 +02:00
8e69d784fc
os 2024-09-29 20:17:19 +02:00
323a1df906
url_pypi 2024-09-29 19:11:10 +02:00
8d978b6cee
venv/action 2024-09-29 17:31:06 +02:00
1a78ce53e7
venvs/list 2024-09-29 17:28:16 +02:00
44a925feb4
venvs/link 2024-09-29 17:26:02 +02:00
b0a3ae00eb
venvs/install 2024-09-29 17:23:06 +02:00
e3051799b0
venvs/uv 2024-09-29 17:19:15 +02:00
1217bf8115
venvs/create 2024-09-29 17:16:17 +02:00

80
re.sh
View file

@ -2,7 +2,7 @@
root="/prj/venv" root="/prj/venv"
url="http://localhost:8000" url="http://localhost:8000"
url_pypi="${url}/pypi/simple" url_pypi="${url}/pypi/os/simple"
activate() { activate() {
echo echo
@ -105,8 +105,49 @@ venvs() {
"3.11" \ "3.11" \
"3.10" "3.10"
for version in "${@}"; do for version in "${@}"; do
url_pypi="${url}/pypi/${version}/simple"
venv="${root}/${version}" venv="${root}/${version}"
echo
echo "${venv}${action}"
case "${action}" in case "${action}" in
"create")
export UV_PYTHON_INSTALL_DIR="${venv}/cpypy"
echo "→ install python ${version}"
uv_python "${venv}" "${version}"
echo "→ create venv ${version}"
uv_venv "${venv}" "${version}"
unset UV_PYTHON_INSTALL_DIR
;;
"init")
activate "${venv}"
pip_install "uv"
deactivate
;;
"install")
activate "${venv}"
uv_install
deactivate
;;
"link")
activate "${venv}"
for module in "rwx"; do
ln --symbolic \
"/rwx/rwx/${module}" \
"${venv}/lib/python${version}/site-packages/${module}"
done
deactivate
;;
"list")
activate "${venv}"
list_venv "${venv}"
deactivate
;;
"relate")
absolute="$(readlink -f "${venv}/bin/python")"
prevenv="$(readlink -f "${venv}")"
relative=$(echo "${absolute}" | sed "s|${prevenv}|..|")
ln --force --symbolic "${relative}" "${venv}/bin/python"
;;
*) ;; *) ;;
esac esac
done done
@ -123,38 +164,13 @@ list_venv "${os}"
pip_install --upgrade "pip" pip_install --upgrade "pip"
pip_install "uv" pip_install "uv"
list_venv "${os}" list_venv "${os}"
venvs create
for version in "${@}"; do
py="${root}/${version}"
export UV_PYTHON_INSTALL_DIR="${py}/cpypy"
echo "→ install python ${version}"
uv_python "${py}" "${version}"
echo "→ create venv ${version}"
uv_venv "${py}" "${version}"
unset UV_PYTHON_INSTALL_DIR
done
deactivate deactivate
for version in "${@}"; do venvs init
py="${root}/${version}" venvs relate
activate "${py}" venvs link
list_venv "${py}" venvs install
pip_install "uv" venvs list
list_venv "${py}"
deactivate
done
for version in "${@}"; do
py="${root}/${version}"
activate "${py}"
uv_install
for module in "rwx"; do
ln --symbolic \
"/rwx/rwx/${module}" \
"${py}/lib/python${version}/site-packages/${module}"
done
list_venv "${py}"
deactivate
done
caches list_venv caches list_venv