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"
url="http://localhost:8000"
url_pypi="${url}/pypi/simple"
url_pypi="${url}/pypi/os/simple"
activate() {
echo
@ -105,8 +105,49 @@ venvs() {
"3.11" \
"3.10"
for version in "${@}"; do
url_pypi="${url}/pypi/${version}/simple"
venv="${root}/${version}"
echo
echo "${venv}${action}"
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
done
@ -123,38 +164,13 @@ list_venv "${os}"
pip_install --upgrade "pip"
pip_install "uv"
list_venv "${os}"
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
venvs create
deactivate
for version in "${@}"; do
py="${root}/${version}"
activate "${py}"
list_venv "${py}"
pip_install "uv"
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
venvs init
venvs relate
venvs link
venvs install
venvs list
caches list_venv