Compare commits

...

9 commits

Author SHA1 Message Date
e0059fb8c5
fix 2024-09-30 10:19:24 +02:00
295c9c67f2
lib/rwx 2024-09-30 10:16:02 +02:00
46d7b287a6
versions 2024-09-30 10:13:07 +02:00
e71fc92be5
bin/python 2024-09-30 10:09:04 +02:00
263a2db4a9
url_pypi 2024-09-30 08:41:08 +02:00
af9448da3a
merged 2024-09-30 08:33:52 +02:00
e576cf24ee
/pypy 2024-09-29 22:06:17 +02:00
925cbbdeca
pypy 2024-09-29 21:41:09 +02:00
fdc01a98b6
no-dl 2024-09-29 21:34:47 +02:00

27
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/os/simple" url_pypi="${url}/pypi/simple"
activate() { activate() {
echo echo
@ -39,7 +39,8 @@ list() {
ls -a -l "${1}/${2}" ls -a -l "${1}/${2}"
} }
list_venv() { list_venv() {
list "${1}" "bin" list "${1}" "bin/python"
list "${1}" "lib/$(basename "${1}")/site-packages/rwx"
} }
pip_install() { pip_install() {
echo echo
@ -84,14 +85,18 @@ set \
uv_python() { uv_python() {
echo echo
export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy"
uv python install "${2}" export UV_PYPY_INSTALL_MIRROR="${UV_PYTHON_INSTALL_MIRROR}/pypy"
unset UV_PYTHON_INSTALL_MIRROR uv python install "${1}"
unset \
UV_PYPY_INSTALL_MIRROR \
UV_PYTHON_INSTALL_MIRROR
} }
uv_venv() { uv_venv() {
echo echo
uv venv \ uv venv \
--allow-existing \ --allow-existing \
--index-url "${url_pypi}" \ --index-url "${url_pypi}" \
--no-python-downloads \
--python "${2}" \ --python "${2}" \
--relocatable \ --relocatable \
--seed \ --seed \
@ -101,11 +106,11 @@ venvs() {
local action="${1}" local action="${1}"
local venv version local venv version
set \ set \
"3.12" \ "python3.12" \
"3.11" \ "python3.11" \
"3.10" "python3.10" \
"pypy3.10"
for version in "${@}"; do for version in "${@}"; do
url_pypi="${url}/pypi/${version}/simple"
venv="${root}/${version}" venv="${root}/${version}"
echo echo
echo "${venv}${action}" echo "${venv}${action}"
@ -113,7 +118,7 @@ venvs() {
"create") "create")
export UV_PYTHON_INSTALL_DIR="${venv}/cpypy" export UV_PYTHON_INSTALL_DIR="${venv}/cpypy"
echo "→ install python ${version}" echo "→ install python ${version}"
uv_python "${venv}" "${version}" uv_python "${version}"
echo "→ create venv ${version}" echo "→ create venv ${version}"
uv_venv "${venv}" "${version}" uv_venv "${venv}" "${version}"
unset UV_PYTHON_INSTALL_DIR unset UV_PYTHON_INSTALL_DIR
@ -133,7 +138,7 @@ venvs() {
for module in "rwx"; do for module in "rwx"; do
ln --symbolic \ ln --symbolic \
"/rwx/rwx/${module}" \ "/rwx/rwx/${module}" \
"${venv}/lib/python${version}/site-packages/${module}" "${venv}/lib/${version}/site-packages/${module}"
done done
deactivate deactivate
;; ;;
@ -173,4 +178,4 @@ venvs link
venvs install venvs install
venvs list venvs list
caches list_venv caches list