Compare commits

..

No commits in common. "e0059fb8c562678ce0eb99ffc7ca3b2b5d44915b" and "f64ebcd0f14af1b298f7e6dbc1c24794bae1ccbb" have entirely different histories.

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