command,list_venv

This commit is contained in:
Marc Beninca 2024-09-29 14:10:06 +02:00
parent 0ba236e266
commit f7de33f0e4
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

22
re.sh
View file

@ -15,13 +15,16 @@ activate() {
pip --version pip --version
} }
caches() { caches() {
local command="${1}"
set \ set \
".cache/pip" \ ".cache/pip" \
".cache/uv" \ ".cache/uv" \
".local/share/pip" \ ".local/share/pip" \
".local/share/uv" ".local/share/uv"
echo
echo "caches:"
for cache in "${@}"; do for cache in "${@}"; do
"${1}" "${HOME}/${cache}" "${command}" "${HOME}/${cache}"
done done
} }
deactivate() { deactivate() {
@ -33,7 +36,10 @@ deactivate() {
} }
list() { list() {
echo echo
ls -a -l "${1}/bin" ls -a -l "${1}/${2}"
}
list_venv() {
list "${1}" "bin"
} }
pip_install() { pip_install() {
echo echo
@ -98,10 +104,10 @@ os="${root}/os"
remove "${os}" remove "${os}"
python3 -m "venv" "${os}" python3 -m "venv" "${os}"
activate "${os}" activate "${os}"
list "${os}" list_venv "${os}"
pip_install --upgrade "pip" pip_install --upgrade "pip"
pip_install "uv" pip_install "uv"
list "${os}" list_venv "${os}"
set \ set \
"3.12" "3.12"
@ -121,16 +127,16 @@ deactivate
for version in "${@}"; do for version in "${@}"; do
activate "${py}" activate "${py}"
list "${py}" list_venv "${py}"
pip_install "uv" pip_install "uv"
list "${py}" list_venv "${py}"
uv_install uv_install
for module in "rwx"; do for module in "rwx"; do
ln --symbolic \ ln --symbolic \
"/rwx/rwx/${module}" \ "/rwx/rwx/${module}" \
"${py}/lib/python${version}/site-packages/${module}" "${py}/lib/python${version}/site-packages/${module}"
done done
list "${py}" list_venv "${py}"
done done
caches ls caches list_venv