Compare commits
3 Commits
ea8985ade5
...
879f8b5d08
Author | SHA1 | Date | |
---|---|---|---|
|
879f8b5d08 | ||
|
cb66429cb6 | ||
|
09729afd48 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.venv
|
@@ -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
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user