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/haskell_playground
|
||||||
build /home/_aspil0w/git/IntershipReport
|
build /home/_aspil0w/git/IntershipReport
|
||||||
build /home/_aspil0w/git/notebook
|
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 no_ssl
|
||||||
build /home/_aspil0w/git/portfolio_ivo no-ssl
|
build /home/_aspil0w/git/portfolio_ivo no-ssl
|
||||||
build /home/_aspil0w/git/SimpleGradientDescent
|
build /home/_aspil0w/git/SimpleGradientDescent
|
||||||
|
@@ -1,40 +1,28 @@
|
|||||||
#!/bin/sh
|
#!/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'
|
VENV_PATH='./.venv'
|
||||||
|
|
||||||
update(){
|
python3.12 -m venv --upgrade-deps "$VENV_PATH"
|
||||||
fd requirements.txt ~ | while read -r filename; do
|
if [ -f "$VENV_PATH"/Scripts/activate ]; then . "$VENV_PATH"/Scripts/activate
|
||||||
echo "Updating : $filename"
|
elif [ -f "$VENV_PATH"/bin/activate ]; then . "$VENV_PATH"/bin/activate
|
||||||
|
else exit 1; fi
|
||||||
python -m venv --upgrade-deps "$VENV_PATH"
|
pip install --disable-pip-version pur
|
||||||
if [ -f "$VENV_PATH"/Scripts/activate ]; then . "$VENV_PATH"/Scripts/activate
|
fd requirements.txt ~ | while read -r filename; do
|
||||||
elif [ -f "$VENV_PATH"/bin/activate ]; then . "$VENV_PATH"/bin/activate
|
header "$(realpath "$filename" | sed "s,$HOME,~,")"
|
||||||
else exit 1; fi
|
pur -r "$filename"
|
||||||
grep -e '^[^#]' "$filename" | cut -d = -f 1 | xargs pip install -U
|
done
|
||||||
|
deactivate
|
||||||
TEMP_FILE=$(mktemp)
|
rm -rf "$VENV_PATH"
|
||||||
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
|
|
||||||
|
Reference in New Issue
Block a user