Compare commits

...

3 Commits

Author SHA1 Message Date
saundersp
879f8b5d08 Added .gitignore 2025-04-26 18:15:40 +02:00
saundersp
cb66429cb6 docker_build : Removed ollama-webui directory 2025-04-26 18:14:03 +02:00
saundersp
09729afd48 update_req.sh : Changed manual updating to pur package usage 2025-04-26 18:13:41 +02:00
3 changed files with 25 additions and 37 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.venv

View File

@@ -52,7 +52,6 @@ build /home/_aspil0w/git/ESP32Manager
build /home/_aspil0w/git/haskell_playground
build /home/_aspil0w/git/IntershipReport
build /home/_aspil0w/git/notebook
build /home/_aspil0w/git/workspace/personnal_projects/ollama-webui
build /home/_aspil0w/git/portfolio no_ssl
build /home/_aspil0w/git/portfolio_ivo no-ssl
build /home/_aspil0w/git/SimpleGradientDescent

View File

@@ -1,40 +1,28 @@
#!/bin/sh
repeat_char(){
end="$1"
for _ in $(seq 1 "$end") ; do
printf '%s' "$2";
done
}
header(){
env printf "$(repeat_char 150)┐\n"
env printf '│ %-148s │\n' "$1"
env printf "$(repeat_char 150 '─')┘\n"
}
VENV_PATH='./.venv'
update(){
fd requirements.txt ~ | while read -r filename; do
echo "Updating : $filename"
python -m venv --upgrade-deps "$VENV_PATH"
if [ -f "$VENV_PATH"/Scripts/activate ]; then . "$VENV_PATH"/Scripts/activate
elif [ -f "$VENV_PATH"/bin/activate ]; then . "$VENV_PATH"/bin/activate
else exit 1; fi
grep -e '^[^#]' "$filename" | cut -d = -f 1 | xargs pip install -U
TEMP_FILE=$(mktemp)
pip freeze | grep -E "($(grep -e '^[^#]' "$filename" | cut -d = -f 1 | paste -sd \|))=" > "$TEMP_FILE"
nvim -d "$filename" "$TEMP_FILE"
deactivate
rm -rf "$VENV_PATH" "$TEMP_FILE"
done
}
download(){
python -m venv --upgrade-deps "$VENV_PATH"
if [ -f "$VENV_PATH"/Scripts/activate ]; then . "$VENV_PATH"/Scripts/activate
elif [ -f "$VENV_PATH"/bin/activate ]; then . "$VENV_PATH"/bin/activate
else exit 1; fi
fd requirements.txt ~ | while read -r filename; do
echo "Downloading : $filename"
grep -e '^[^#]' "$filename" | cut -d = -f 1 | xargs pip download
rm *.whl
done
deactivate
rm -rf "$VENV_PATH"
}
update
python3.12 -m venv --upgrade-deps "$VENV_PATH"
if [ -f "$VENV_PATH"/Scripts/activate ]; then . "$VENV_PATH"/Scripts/activate
elif [ -f "$VENV_PATH"/bin/activate ]; then . "$VENV_PATH"/bin/activate
else exit 1; fi
pip install --disable-pip-version pur
fd requirements.txt ~ | while read -r filename; do
header "$(realpath "$filename" | sed "s,$HOME,~,")"
pur -r "$filename"
done
deactivate
rm -rf "$VENV_PATH"