From d6dd102a7ce738ffe90bae99e37f19f6cb10fcde Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 26 Sep 2024 21:27:56 +0200 Subject: [PATCH 01/39] re --- re.sh | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 re.sh diff --git a/re.sh b/re.sh new file mode 100755 index 0000000..3ac5aed --- /dev/null +++ b/re.sh @@ -0,0 +1,108 @@ +#! /usr/bin/env sh + +root="/prj" +url="http://localhost:8000" +url_pypi="${url}/pypi/simple" + +activate() { + echo + export VIRTUAL_ENV="${1}" + echo "→ ${VIRTUAL_ENV}" + export OLD_PATH="${PATH}" + export PATH="${VIRTUAL_ENV}/bin:${PATH}" + echo "→ ${PATH}" + python3 --version + pip --version +} +deactivate() { + echo + echo "← ${VIRTUAL_ENV}" + export PATH="${OLD_PATH}" + echo "← ${PATH}" + unset OLD_PATH VIRTUAL_ENV +} +list() { + echo + ls -a -l "${1}/bin" +} +pip_install() { + echo + pip install --index-url "${url_pypi}" "${@}" +} +remove() { + rm --force --recursive "${@}" +} +uv_install() { + echo + uv pip install --index-url "${url_pypi}" "${@}" +} +uv_python() { + echo + export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" + uv python install + #--cache-dir "${1}/cpypy" + unset UV_PYTHON_INSTALL_MIRROR +} +uv_venv() { + echo + uv venv --index-url "${url_pypi}" --seed "${1}" + #--cache-dir "${1}/cpypy" +} + +remove ~/.cache/pip ~/.local/share/uv + +pip="${root}/venv.pip" +uv="${root}/venv" + +remove "${pip}" "${uv}" + +python3 -m "venv" "${pip}" +activate "${pip}" +list "${pip}" +pip_install --upgrade "pip" +pip_install "uv" +list "${pip}" + +uv_python "${uv}" +uv_venv "${uv}" + +deactivate +remove "${pip}" +activate "${uv}" + +list "${uv}" + +pip_install "uv" + +list "${uv}" + +set \ +\ +"pelican" \ +\ +"hatch" \ +\ +"Sphinx" \ +"sphinx-rtd-theme" \ +\ +"gitlint" \ +"pydoclint" \ +"pylint" \ +"ruff" \ +\ +"pytest" \ +\ +"toml" \ +\ +"twine" \ +\ +"mypy" \ +"pyright" \ +\ +"ruamel.yaml" \ +"PyYAML" \ +"types-PyYAML" + +uv_install "${@}" + +list "${uv}" From 6491592e721ffa0d0d6ee71db5e21c4a0cd7befc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 28 Sep 2024 22:47:29 +0200 Subject: [PATCH 02/39] tabs --- re.sh | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/re.sh b/re.sh index 3ac5aed..2a0892e 100755 --- a/re.sh +++ b/re.sh @@ -77,31 +77,31 @@ pip_install "uv" list "${uv}" set \ -\ -"pelican" \ -\ -"hatch" \ -\ -"Sphinx" \ -"sphinx-rtd-theme" \ -\ -"gitlint" \ -"pydoclint" \ -"pylint" \ -"ruff" \ -\ -"pytest" \ -\ -"toml" \ -\ -"twine" \ -\ -"mypy" \ -"pyright" \ -\ -"ruamel.yaml" \ -"PyYAML" \ -"types-PyYAML" + \ + "pelican" \ + \ + "hatch" \ + \ + "Sphinx" \ + "sphinx-rtd-theme" \ + \ + "gitlint" \ + "pydoclint" \ + "pylint" \ + "ruff" \ + \ + "pytest" \ + \ + "toml" \ + \ + "twine" \ + \ + "mypy" \ + "pyright" \ + \ + "ruamel.yaml" \ + "PyYAML" \ + "types-PyYAML" uv_install "${@}" From ac89a75a7df899419f4654b415afb0f2b089c4eb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 28 Sep 2024 22:49:09 +0200 Subject: [PATCH 03/39] tabs --- re.sh | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/re.sh b/re.sh index 2a0892e..635ccc3 100755 --- a/re.sh +++ b/re.sh @@ -5,48 +5,48 @@ url="http://localhost:8000" url_pypi="${url}/pypi/simple" activate() { - echo - export VIRTUAL_ENV="${1}" - echo "→ ${VIRTUAL_ENV}" - export OLD_PATH="${PATH}" - export PATH="${VIRTUAL_ENV}/bin:${PATH}" - echo "→ ${PATH}" - python3 --version - pip --version + echo + export VIRTUAL_ENV="${1}" + echo "→ ${VIRTUAL_ENV}" + export OLD_PATH="${PATH}" + export PATH="${VIRTUAL_ENV}/bin:${PATH}" + echo "→ ${PATH}" + python3 --version + pip --version } deactivate() { - echo - echo "← ${VIRTUAL_ENV}" - export PATH="${OLD_PATH}" - echo "← ${PATH}" - unset OLD_PATH VIRTUAL_ENV + echo + echo "← ${VIRTUAL_ENV}" + export PATH="${OLD_PATH}" + echo "← ${PATH}" + unset OLD_PATH VIRTUAL_ENV } list() { - echo - ls -a -l "${1}/bin" + echo + ls -a -l "${1}/bin" } pip_install() { - echo - pip install --index-url "${url_pypi}" "${@}" + echo + pip install --index-url "${url_pypi}" "${@}" } remove() { - rm --force --recursive "${@}" + rm --force --recursive "${@}" } uv_install() { - echo - uv pip install --index-url "${url_pypi}" "${@}" + echo + uv pip install --index-url "${url_pypi}" "${@}" } uv_python() { - echo - export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" - uv python install - #--cache-dir "${1}/cpypy" - unset UV_PYTHON_INSTALL_MIRROR + echo + export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" + uv python install + #--cache-dir "${1}/cpypy" + unset UV_PYTHON_INSTALL_MIRROR } uv_venv() { - echo - uv venv --index-url "${url_pypi}" --seed "${1}" - #--cache-dir "${1}/cpypy" + echo + uv venv --index-url "${url_pypi}" --seed "${1}" + #--cache-dir "${1}/cpypy" } remove ~/.cache/pip ~/.local/share/uv From 59f569b2ee5026af9e036e4e935ec0686f0b07cf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 28 Sep 2024 23:01:05 +0200 Subject: [PATCH 04/39] \ --- re.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/re.sh b/re.sh index 635ccc3..90863cc 100755 --- a/re.sh +++ b/re.sh @@ -86,6 +86,7 @@ set \ "sphinx-rtd-theme" \ \ "gitlint" \ + \ "pydoclint" \ "pylint" \ "ruff" \ From 114aabce9cd1b07461bb91386f425831d05e704a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 28 Sep 2024 23:40:14 +0200 Subject: [PATCH 05/39] rwx --- re.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/re.sh b/re.sh index 90863cc..a3b0bd6 100755 --- a/re.sh +++ b/re.sh @@ -106,4 +106,6 @@ set \ uv_install "${@}" +ln --symbolic "/rwx/rwx/rwx" "${uv}/lib/python"*"/site-packages/rwx" + list "${uv}" From a5720bcb4337e39192df0e5531d76625c9750c53 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 28 Sep 2024 23:41:07 +0200 Subject: [PATCH 06/39] pip --- re.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.sh b/re.sh index a3b0bd6..b1c1652 100755 --- a/re.sh +++ b/re.sh @@ -67,7 +67,7 @@ uv_python "${uv}" uv_venv "${uv}" deactivate -remove "${pip}" +# remove "${pip}" activate "${uv}" list "${uv}" From 4b09ebadc285e4ea742fe5552aa0769504034c39 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 28 Sep 2024 23:47:31 +0200 Subject: [PATCH 07/39] os --- re.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/re.sh b/re.sh index b1c1652..31fbafc 100755 --- a/re.sh +++ b/re.sh @@ -51,23 +51,23 @@ uv_venv() { remove ~/.cache/pip ~/.local/share/uv -pip="${root}/venv.pip" +os="${root}/venv.os" uv="${root}/venv" -remove "${pip}" "${uv}" +remove "${os}" "${uv}" -python3 -m "venv" "${pip}" -activate "${pip}" -list "${pip}" +python3 -m "venv" "${os}" +activate "${os}" +list "${os}" pip_install --upgrade "pip" pip_install "uv" -list "${pip}" +list "${os}" uv_python "${uv}" uv_venv "${uv}" deactivate -# remove "${pip}" +# remove "${os}" activate "${uv}" list "${uv}" From d4b83a1bfa091c0f28ca7cd72fff6c8ce462b77a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 28 Sep 2024 23:52:50 +0200 Subject: [PATCH 08/39] py --- re.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/re.sh b/re.sh index 31fbafc..68deaed 100755 --- a/re.sh +++ b/re.sh @@ -52,9 +52,9 @@ uv_venv() { remove ~/.cache/pip ~/.local/share/uv os="${root}/venv.os" -uv="${root}/venv" +py="${root}/venv" -remove "${os}" "${uv}" +remove "${os}" "${py}" python3 -m "venv" "${os}" activate "${os}" @@ -63,18 +63,18 @@ pip_install --upgrade "pip" pip_install "uv" list "${os}" -uv_python "${uv}" -uv_venv "${uv}" +uv_python "${py}" +uv_venv "${py}" deactivate # remove "${os}" -activate "${uv}" +activate "${py}" -list "${uv}" +list "${py}" pip_install "uv" -list "${uv}" +list "${py}" set \ \ @@ -106,6 +106,6 @@ set \ uv_install "${@}" -ln --symbolic "/rwx/rwx/rwx" "${uv}/lib/python"*"/site-packages/rwx" +ln --symbolic "/rwx/rwx/rwx" "${py}/lib/python"*"/site-packages/rwx" -list "${uv}" +list "${py}" From 02ebf0d2cdc53a17933c28d3433a7cfee2504b52 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 28 Sep 2024 23:58:18 +0200 Subject: [PATCH 09/39] relocatable --- re.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.sh b/re.sh index 68deaed..db09b3c 100755 --- a/re.sh +++ b/re.sh @@ -45,7 +45,7 @@ uv_python() { } uv_venv() { echo - uv venv --index-url "${url_pypi}" --seed "${1}" + uv venv --index-url "${url_pypi}" --relocatable --seed "${1}" #--cache-dir "${1}/cpypy" } From 7e1f425dd48e2dc2d9b420fca849c4ac81bd4c7d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 02:16:09 +0200 Subject: [PATCH 10/39] mv --- re.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/re.sh b/re.sh index db09b3c..c0a41cf 100755 --- a/re.sh +++ b/re.sh @@ -40,13 +40,18 @@ uv_python() { echo export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" uv python install - #--cache-dir "${1}/cpypy" unset UV_PYTHON_INSTALL_MIRROR + mkdir --parents "${1}/cpypy" + mv ~/.local/share/uv/python/* "${1}/cpypy" } uv_venv() { echo - uv venv --index-url "${url_pypi}" --relocatable --seed "${1}" - #--cache-dir "${1}/cpypy" + uv venv \ + --allow-existing \ + --index-url "${url_pypi}" \ + --relocatable \ + --seed \ + "${1}" } remove ~/.cache/pip ~/.local/share/uv From 9d537b224733dce58d121b854ff20450e7ee730c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 12:12:31 +0200 Subject: [PATCH 11/39] dir --- re.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/re.sh b/re.sh index c0a41cf..96be2ae 100755 --- a/re.sh +++ b/re.sh @@ -38,16 +38,16 @@ uv_install() { } uv_python() { echo + export UV_PYTHON_INSTALL_DIR="${1}/cpypy" export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" uv python install - unset UV_PYTHON_INSTALL_MIRROR - mkdir --parents "${1}/cpypy" - mv ~/.local/share/uv/python/* "${1}/cpypy" + unset \ + UV_PYTHON_INSTALL_DIR \ + UV_PYTHON_INSTALL_MIRROR } uv_venv() { echo uv venv \ - --allow-existing \ --index-url "${url_pypi}" \ --relocatable \ --seed \ From 9616edc52351df336d559695d34b3c757fc79497 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 12:19:08 +0200 Subject: [PATCH 12/39] uv_install --- re.sh | 56 +++++++++++++++++++++++++++----------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/re.sh b/re.sh index 96be2ae..cb4c4c6 100755 --- a/re.sh +++ b/re.sh @@ -33,6 +33,32 @@ remove() { rm --force --recursive "${@}" } uv_install() { +set \ + "pelican" \ + \ + "hatch" \ + \ + "Sphinx" \ + "sphinx-rtd-theme" \ + \ + "gitlint" \ + \ + "pydoclint" \ + "pylint" \ + "ruff" \ + \ + "pytest" \ + \ + "toml" \ + \ + "twine" \ + \ + "mypy" \ + "pyright" \ + \ + "ruamel.yaml" \ + "PyYAML" \ + "types-PyYAML" echo uv pip install --index-url "${url_pypi}" "${@}" } @@ -81,35 +107,7 @@ pip_install "uv" list "${py}" -set \ - \ - "pelican" \ - \ - "hatch" \ - \ - "Sphinx" \ - "sphinx-rtd-theme" \ - \ - "gitlint" \ - \ - "pydoclint" \ - "pylint" \ - "ruff" \ - \ - "pytest" \ - \ - "toml" \ - \ - "twine" \ - \ - "mypy" \ - "pyright" \ - \ - "ruamel.yaml" \ - "PyYAML" \ - "types-PyYAML" - -uv_install "${@}" +uv_install ln --symbolic "/rwx/rwx/rwx" "${py}/lib/python"*"/site-packages/rwx" From b91acf76de9b84cc4531d4b1b89ec3dda3339fc2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 12:23:20 +0200 Subject: [PATCH 13/39] useless --- re.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.sh b/re.sh index cb4c4c6..b24e0a5 100755 --- a/re.sh +++ b/re.sh @@ -80,7 +80,7 @@ uv_venv() { "${1}" } -remove ~/.cache/pip ~/.local/share/uv +remove ~/.cache/pip os="${root}/venv.os" py="${root}/venv" From e5123c896fd2193ce2d71962b9f7c913c44038d1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 12:23:57 +0200 Subject: [PATCH 14/39] clean --- re.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.sh b/re.sh index b24e0a5..06255ba 100755 --- a/re.sh +++ b/re.sh @@ -98,7 +98,7 @@ uv_python "${py}" uv_venv "${py}" deactivate -# remove "${os}" + activate "${py}" list "${py}" From 34225beee3ab9daf09491c87b701eadb3de63f01 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 12:53:34 +0200 Subject: [PATCH 15/39] venvs --- re.sh | 54 +++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/re.sh b/re.sh index 06255ba..2bd90c5 100755 --- a/re.sh +++ b/re.sh @@ -1,6 +1,6 @@ #! /usr/bin/env sh -root="/prj" +root="/prj/venv" url="http://localhost:8000" url_pypi="${url}/pypi/simple" @@ -27,7 +27,10 @@ list() { } pip_install() { echo - pip install --index-url "${url_pypi}" "${@}" + pip install \ + --index-url "${url_pypi}" \ + --no-cache-dir \ + "${@}" } remove() { rm --force --recursive "${@}" @@ -66,7 +69,7 @@ uv_python() { echo export UV_PYTHON_INSTALL_DIR="${1}/cpypy" export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" - uv python install + uv python install "${2}" unset \ UV_PYTHON_INSTALL_DIR \ UV_PYTHON_INSTALL_MIRROR @@ -80,13 +83,8 @@ uv_venv() { "${1}" } -remove ~/.cache/pip - -os="${root}/venv.os" -py="${root}/venv" - -remove "${os}" "${py}" - +os="${root}/os" +remove "${os}" python3 -m "venv" "${os}" activate "${os}" list "${os}" @@ -94,21 +92,27 @@ pip_install --upgrade "pip" pip_install "uv" list "${os}" -uv_python "${py}" -uv_venv "${py}" +set \ + "3.12" + +for version in "${@}"; do + py="${root}/${version}" + remove "${py}" + uv_python "${py}" "${version}" + uv_venv "${py}" +done deactivate -activate "${py}" - -list "${py}" - -pip_install "uv" - -list "${py}" - -uv_install - -ln --symbolic "/rwx/rwx/rwx" "${py}/lib/python"*"/site-packages/rwx" - -list "${py}" +for version in "${@}"; do + activate "${py}" + list "${py}" + pip_install "uv" + list "${py}" + uv_install + for module in "rwx"; do + ln --symbolic \ + "/rwx/rwx/${module}" \ + "${py}/lib/python${version}/site-packages/${module}" + list "${py}" +done From 7e876c76429318d6e158bd6dadb3fb0d22d2280a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 12:54:58 +0200 Subject: [PATCH 16/39] allow-existing --- re.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/re.sh b/re.sh index 2bd90c5..6b77363 100755 --- a/re.sh +++ b/re.sh @@ -77,6 +77,7 @@ uv_python() { uv_venv() { echo uv venv \ + --allow-existing \ --index-url "${url_pypi}" \ --relocatable \ --seed \ From 59b25759c19468224dad41c049de2fdcf0b2a764 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 12:56:14 +0200 Subject: [PATCH 17/39] done --- re.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/re.sh b/re.sh index 6b77363..6bb7a73 100755 --- a/re.sh +++ b/re.sh @@ -115,5 +115,6 @@ for version in "${@}"; do ln --symbolic \ "/rwx/rwx/${module}" \ "${py}/lib/python${version}/site-packages/${module}" + done list "${py}" done From 9e8b139a812f842ee2847743355ee4e49408bfd5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 13:19:30 +0200 Subject: [PATCH 18/39] venv/python --- re.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/re.sh b/re.sh index 6bb7a73..d48176b 100755 --- a/re.sh +++ b/re.sh @@ -79,6 +79,7 @@ uv_venv() { uv venv \ --allow-existing \ --index-url "${url_pypi}" \ + --python "${2}" \ --relocatable \ --seed \ "${1}" @@ -100,7 +101,7 @@ for version in "${@}"; do py="${root}/${version}" remove "${py}" uv_python "${py}" "${version}" - uv_venv "${py}" + uv_venv "${py}" "${version}" done deactivate From 17f8310bfbdd68d8b134b24ed090ea1c0e2099fa Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 13:42:43 +0200 Subject: [PATCH 19/39] dir/py,venv --- re.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/re.sh b/re.sh index d48176b..feaaab7 100755 --- a/re.sh +++ b/re.sh @@ -67,12 +67,9 @@ set \ } uv_python() { echo - export UV_PYTHON_INSTALL_DIR="${1}/cpypy" export UV_PYTHON_INSTALL_MIRROR="${url}/cpypy" uv python install "${2}" - unset \ - UV_PYTHON_INSTALL_DIR \ - UV_PYTHON_INSTALL_MIRROR + unset UV_PYTHON_INSTALL_MIRROR } uv_venv() { echo @@ -100,8 +97,12 @@ set \ for version in "${@}"; do py="${root}/${version}" remove "${py}" + export UV_PYTHON_INSTALL_DIR="${1}/cpypy" + echo "→ install python ${version}" uv_python "${py}" "${version}" + echo "→ create venv ${version}" uv_venv "${py}" "${version}" + unset UV_PYTHON_INSTALL_DIR done deactivate From 1824fe3338da46d0a47989df3cb8b6f70393d981 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 13:47:07 +0200 Subject: [PATCH 20/39] fix --- re.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.sh b/re.sh index feaaab7..695b2e7 100755 --- a/re.sh +++ b/re.sh @@ -97,7 +97,7 @@ set \ for version in "${@}"; do py="${root}/${version}" remove "${py}" - export UV_PYTHON_INSTALL_DIR="${1}/cpypy" + export UV_PYTHON_INSTALL_DIR="${py}/cpypy" echo "→ install python ${version}" uv_python "${py}" "${version}" echo "→ create venv ${version}" From c08d4a8fb8d6fb186a77999f7a4cc96d02b95d8b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 13:54:57 +0200 Subject: [PATCH 21/39] caches --- re.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/re.sh b/re.sh index 695b2e7..31aa2fd 100755 --- a/re.sh +++ b/re.sh @@ -14,6 +14,16 @@ activate() { python3 --version pip --version } +caches() { + set \ + ".cache/pip" \ + ".cache/uv" \ + ".local/share/pip" \ + ".local/share/uv" + for cache in "${@}"; do + "${1}" "${cache}" + done +} deactivate() { echo echo "← ${VIRTUAL_ENV}" From 9f15391fe264955c1b79f72f640d35814db7b2cd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 13:56:10 +0200 Subject: [PATCH 22/39] caches/remove,ls --- re.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/re.sh b/re.sh index 31aa2fd..1ff6d33 100755 --- a/re.sh +++ b/re.sh @@ -92,6 +92,8 @@ uv_venv() { "${1}" } +caches remove + os="${root}/os" remove "${os}" python3 -m "venv" "${os}" @@ -130,3 +132,5 @@ for version in "${@}"; do done list "${py}" done + +caches ls From 0ba236e26641f6b5d8555dd7c6953d952f30529d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 13:59:43 +0200 Subject: [PATCH 23/39] home/ --- re.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.sh b/re.sh index 1ff6d33..d852276 100755 --- a/re.sh +++ b/re.sh @@ -21,7 +21,7 @@ caches() { ".local/share/pip" \ ".local/share/uv" for cache in "${@}"; do - "${1}" "${cache}" + "${1}" "${HOME}/${cache}" done } deactivate() { From f7de33f0e4d7d6064c5d5a6ad0b5a0a1632b7acc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 14:10:06 +0200 Subject: [PATCH 24/39] command,list_venv --- re.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/re.sh b/re.sh index d852276..8302999 100755 --- a/re.sh +++ b/re.sh @@ -15,13 +15,16 @@ activate() { pip --version } caches() { + local command="${1}" set \ ".cache/pip" \ ".cache/uv" \ ".local/share/pip" \ ".local/share/uv" + echo + echo "caches:" for cache in "${@}"; do - "${1}" "${HOME}/${cache}" + "${command}" "${HOME}/${cache}" done } deactivate() { @@ -33,7 +36,10 @@ deactivate() { } list() { echo - ls -a -l "${1}/bin" + ls -a -l "${1}/${2}" +} +list_venv() { + list "${1}" "bin" } pip_install() { echo @@ -98,10 +104,10 @@ os="${root}/os" remove "${os}" python3 -m "venv" "${os}" activate "${os}" -list "${os}" +list_venv "${os}" pip_install --upgrade "pip" pip_install "uv" -list "${os}" +list_venv "${os}" set \ "3.12" @@ -121,16 +127,16 @@ deactivate for version in "${@}"; do activate "${py}" - list "${py}" + list_venv "${py}" pip_install "uv" - list "${py}" + list_venv "${py}" uv_install for module in "rwx"; do ln --symbolic \ "/rwx/rwx/${module}" \ "${py}/lib/python${version}/site-packages/${module}" done - list "${py}" + list_venv "${py}" done -caches ls +caches list_venv From 8f3f727ad32f0fb29e4c4d181ee685ad0af35c31 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 16:13:38 +0200 Subject: [PATCH 25/39] 11,10 --- re.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/re.sh b/re.sh index 8302999..c954de4 100755 --- a/re.sh +++ b/re.sh @@ -110,7 +110,9 @@ pip_install "uv" list_venv "${os}" set \ - "3.12" + "3.12" \ + "3.11" \ + "3.10" for version in "${@}"; do py="${root}/${version}" From 34dc630b2f0c317a7406652f8464872e12c69467 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 16:21:42 +0200 Subject: [PATCH 26/39] deactivate --- re.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/re.sh b/re.sh index c954de4..ad6c9d5 100755 --- a/re.sh +++ b/re.sh @@ -139,6 +139,7 @@ for version in "${@}"; do "${py}/lib/python${version}/site-packages/${module}" done list_venv "${py}" + deactivate done caches list_venv From 1482de91c29ca85fa9655046be19f5094e2706db Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 16:38:38 +0200 Subject: [PATCH 27/39] split --- re.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/re.sh b/re.sh index ad6c9d5..47e62ba 100755 --- a/re.sh +++ b/re.sh @@ -128,10 +128,16 @@ done 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 \ From d7765033ceacd8de90c6a655cfa72340cc6ba530 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 17:07:32 +0200 Subject: [PATCH 28/39] venvs/start --- re.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/re.sh b/re.sh index 47e62ba..85b2efa 100755 --- a/re.sh +++ b/re.sh @@ -97,6 +97,20 @@ uv_venv() { --seed \ "${1}" } +venvs() { + local action="${1}" + local venv version + set \ + "3.12" \ + "3.11" \ + "3.10" + for version in "${@}"; do + venv="${root}/${version}" + case "${action}" in + *) ;; + esac + done +} caches remove @@ -109,11 +123,6 @@ pip_install --upgrade "pip" pip_install "uv" list_venv "${os}" -set \ - "3.12" \ - "3.11" \ - "3.10" - for version in "${@}"; do py="${root}/${version}" remove "${py}" From d4b8d62d412f85ccc604f3ad130ff4f76498d2e3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 17:10:59 +0200 Subject: [PATCH 29/39] root --- re.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/re.sh b/re.sh index 85b2efa..ba00941 100755 --- a/re.sh +++ b/re.sh @@ -114,8 +114,9 @@ venvs() { caches remove +remove "${root}" + os="${root}/os" -remove "${os}" python3 -m "venv" "${os}" activate "${os}" list_venv "${os}" @@ -125,7 +126,6 @@ list_venv "${os}" for version in "${@}"; do py="${root}/${version}" - remove "${py}" export UV_PYTHON_INSTALL_DIR="${py}/cpypy" echo "→ install python ${version}" uv_python "${py}" "${version}" From 1217bf8115edd86ef5fec288268f21289a3ae6b2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 17:16:17 +0200 Subject: [PATCH 30/39] venvs/create --- re.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/re.sh b/re.sh index ba00941..0f483a1 100755 --- a/re.sh +++ b/re.sh @@ -107,6 +107,14 @@ venvs() { for version in "${@}"; do venv="${root}/${version}" 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 + ;; *) ;; esac done @@ -123,17 +131,7 @@ 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 From e3051799b0a14d8dafe0b5c80116f9d6eafef2c7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 17:19:15 +0200 Subject: [PATCH 31/39] venvs/uv --- re.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/re.sh b/re.sh index 0f483a1..087f7ca 100755 --- a/re.sh +++ b/re.sh @@ -115,6 +115,13 @@ venvs() { uv_venv "${venv}" "${version}" unset UV_PYTHON_INSTALL_DIR ;; + "uv") + activate "${venv}" + list_venv "${venv}" + pip_install "uv" + list_venv "${venv}" + deactivate + ;; *) ;; esac done @@ -134,14 +141,7 @@ list_venv "${os}" venvs create deactivate -for version in "${@}"; do - py="${root}/${version}" - activate "${py}" - list_venv "${py}" - pip_install "uv" - list_venv "${py}" - deactivate -done +venvs uv for version in "${@}"; do py="${root}/${version}" activate "${py}" From b0a3ae00eb6707c12a4b0bc098a7ca006f8c0cd7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 17:23:06 +0200 Subject: [PATCH 32/39] venvs/install --- re.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/re.sh b/re.sh index 087f7ca..ad3e15a 100755 --- a/re.sh +++ b/re.sh @@ -115,11 +115,14 @@ venvs() { uv_venv "${venv}" "${version}" unset UV_PYTHON_INSTALL_DIR ;; - "uv") + "init") activate "${venv}" - list_venv "${venv}" pip_install "uv" - list_venv "${venv}" + deactivate + ;; + "install") + activate "${venv}" + uv_install deactivate ;; *) ;; @@ -141,11 +144,10 @@ list_venv "${os}" venvs create deactivate -venvs uv +venvs init for version in "${@}"; do py="${root}/${version}" activate "${py}" - uv_install for module in "rwx"; do ln --symbolic \ "/rwx/rwx/${module}" \ From 44a925feb48c1a178311476a3f4e81c8396d3cb6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 17:26:02 +0200 Subject: [PATCH 33/39] venvs/link --- re.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/re.sh b/re.sh index ad3e15a..c094f2a 100755 --- a/re.sh +++ b/re.sh @@ -125,6 +125,15 @@ venvs() { 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 + ;; *) ;; esac done @@ -148,11 +157,6 @@ venvs init for version in "${@}"; do py="${root}/${version}" activate "${py}" - for module in "rwx"; do - ln --symbolic \ - "/rwx/rwx/${module}" \ - "${py}/lib/python${version}/site-packages/${module}" - done list_venv "${py}" deactivate done From 1a78ce53e7060a1880f17b2d86f4fe12570ed294 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 17:28:16 +0200 Subject: [PATCH 34/39] venvs/list --- re.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/re.sh b/re.sh index c094f2a..d89a031 100755 --- a/re.sh +++ b/re.sh @@ -134,6 +134,11 @@ venvs() { done deactivate ;; + "list") + activate "${venv}" + list_venv "${venv}" + deactivate + ;; *) ;; esac done @@ -154,11 +159,8 @@ venvs create deactivate venvs init -for version in "${@}"; do - py="${root}/${version}" - activate "${py}" - list_venv "${py}" - deactivate -done +venvs link +venvs install +venvs list caches list_venv From 8d978b6cee95e3daf5de0eb7566e426f234cd43a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 17:31:06 +0200 Subject: [PATCH 35/39] venv/action --- re.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/re.sh b/re.sh index d89a031..698e810 100755 --- a/re.sh +++ b/re.sh @@ -106,6 +106,8 @@ venvs() { "3.10" for version in "${@}"; do venv="${root}/${version}" + echo + echo "${venv} ← ${action}" case "${action}" in "create") export UV_PYTHON_INSTALL_DIR="${venv}/cpypy" From 323a1df906b06409afc63c5353f384f38722991d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 19:11:10 +0200 Subject: [PATCH 36/39] url_pypi --- re.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/re.sh b/re.sh index 698e810..b1b1f0c 100755 --- a/re.sh +++ b/re.sh @@ -2,7 +2,7 @@ root="/prj/venv" url="http://localhost:8000" -url_pypi="${url}/pypi/simple" +url_pypi="${url}/pypi/3.12/simple" activate() { echo @@ -105,6 +105,7 @@ venvs() { "3.11" \ "3.10" for version in "${@}"; do + url_pypi="${url}/pypi/${version}/simple" venv="${root}/${version}" echo echo "${venv} ← ${action}" From 8e69d784fceb8e1a70ec4f1b5ef855d9144ab07a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 20:17:19 +0200 Subject: [PATCH 37/39] os --- re.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.sh b/re.sh index b1b1f0c..9308616 100755 --- a/re.sh +++ b/re.sh @@ -2,7 +2,7 @@ root="/prj/venv" url="http://localhost:8000" -url_pypi="${url}/pypi/3.12/simple" +url_pypi="${url}/pypi/os/simple" activate() { echo From 23e3475c91a0655d3cda84bf306e95a66a506550 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 20:49:09 +0200 Subject: [PATCH 38/39] venvs/relate --- re.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/re.sh b/re.sh index 9308616..c3536e3 100755 --- a/re.sh +++ b/re.sh @@ -142,6 +142,12 @@ venvs() { list_venv "${venv}" deactivate ;; + "relate") + absolute="$(readlink -f "${venv}/bin/python")" + prevenv="$(readlink -f "${venv}")" + relative=$(echo "${absolute}" | sed "s|${prevenv}|..|") + echo ln --force --symbolic "${relative}" "${venv}/bin/python" + ;; *) ;; esac done @@ -162,6 +168,7 @@ venvs create deactivate venvs init +venvs relate venvs link venvs install venvs list From f64ebcd0f14af1b298f7e6dbc1c24794bae1ccbb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 29 Sep 2024 20:53:02 +0200 Subject: [PATCH 39/39] fix --- re.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re.sh b/re.sh index c3536e3..b20ba22 100755 --- a/re.sh +++ b/re.sh @@ -146,7 +146,7 @@ venvs() { absolute="$(readlink -f "${venv}/bin/python")" prevenv="$(readlink -f "${venv}")" relative=$(echo "${absolute}" | sed "s|${prevenv}|..|") - echo ln --force --symbolic "${relative}" "${venv}/bin/python" + ln --force --symbolic "${relative}" "${venv}/bin/python" ;; *) ;; esac