This commit is contained in:
Marc Beninca 2024-09-29 12:53:34 +02:00
parent e5123c896f
commit 34225beee3
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

54
re.sh
View file

@ -1,6 +1,6 @@
#! /usr/bin/env sh #! /usr/bin/env sh
root="/prj" root="/prj/venv"
url="http://localhost:8000" url="http://localhost:8000"
url_pypi="${url}/pypi/simple" url_pypi="${url}/pypi/simple"
@ -27,7 +27,10 @@ list() {
} }
pip_install() { pip_install() {
echo echo
pip install --index-url "${url_pypi}" "${@}" pip install \
--index-url "${url_pypi}" \
--no-cache-dir \
"${@}"
} }
remove() { remove() {
rm --force --recursive "${@}" rm --force --recursive "${@}"
@ -66,7 +69,7 @@ uv_python() {
echo echo
export UV_PYTHON_INSTALL_DIR="${1}/cpypy" export UV_PYTHON_INSTALL_DIR="${1}/cpypy"
export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy"
uv python install uv python install "${2}"
unset \ unset \
UV_PYTHON_INSTALL_DIR \ UV_PYTHON_INSTALL_DIR \
UV_PYTHON_INSTALL_MIRROR UV_PYTHON_INSTALL_MIRROR
@ -80,13 +83,8 @@ uv_venv() {
"${1}" "${1}"
} }
remove ~/.cache/pip os="${root}/os"
remove "${os}"
os="${root}/venv.os"
py="${root}/venv"
remove "${os}" "${py}"
python3 -m "venv" "${os}" python3 -m "venv" "${os}"
activate "${os}" activate "${os}"
list "${os}" list "${os}"
@ -94,21 +92,27 @@ pip_install --upgrade "pip"
pip_install "uv" pip_install "uv"
list "${os}" list "${os}"
uv_python "${py}" set \
uv_venv "${py}" "3.12"
for version in "${@}"; do
py="${root}/${version}"
remove "${py}"
uv_python "${py}" "${version}"
uv_venv "${py}"
done
deactivate deactivate
activate "${py}" for version in "${@}"; do
activate "${py}"
list "${py}" list "${py}"
pip_install "uv"
pip_install "uv" list "${py}"
uv_install
list "${py}" for module in "rwx"; do
ln --symbolic \
uv_install "/rwx/rwx/${module}" \
"${py}/lib/python${version}/site-packages/${module}"
ln --symbolic "/rwx/rwx/rwx" "${py}/lib/python"*"/site-packages/rwx" list "${py}"
done
list "${py}"