Start: Rewrite start scripts
Start scripts now don't update dependencies by default due to mishandling caches from pip. Also add dedicated update scripts and save options to a JSON file instead of a text one. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
e66d213aef
commit
7ce46cc2da
7 changed files with 200 additions and 34 deletions
24
update_scripts/update_deps.bat
Normal file
24
update_scripts/update_deps.bat
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
@echo off
|
||||
|
||||
:: Creates a venv if it doesn't exist and runs the start script for requirements upgrades
|
||||
:: This is intended for users who want to start the API and have everything upgraded and installed
|
||||
|
||||
:: cd to the parent directory
|
||||
cd "%~dp0.."
|
||||
|
||||
:: Don't create a venv if a conda environment is active
|
||||
if exist "%CONDA_PREFIX%" (
|
||||
echo It looks like you're in a conda environment. Skipping venv check.
|
||||
) else (
|
||||
if not exist "venv\" (
|
||||
echo Venv doesn't exist! Please run start.bat instead.
|
||||
exit 0
|
||||
)
|
||||
|
||||
call .\venv\Scripts\activate.bat
|
||||
)
|
||||
|
||||
:: Call the python script with batch args
|
||||
call python start.py --update-deps %*
|
||||
|
||||
pause
|
||||
19
update_scripts/update_deps.sh
Normal file
19
update_scripts/update_deps.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")/.." || exit
|
||||
|
||||
if [ -n "$CONDA_PREFIX" ]; then
|
||||
echo "It looks like you're in a conda environment. Skipping venv check."
|
||||
else
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "Venv doesn't exist! Please run start.sh instead."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Activating venv"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
source venv/bin/activate
|
||||
fi
|
||||
|
||||
python3 start.py --update-deps "$@"
|
||||
24
update_scripts/update_deps_and_pull.bat
Normal file
24
update_scripts/update_deps_and_pull.bat
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
@echo off
|
||||
|
||||
:: Creates a venv if it doesn't exist and runs the start script for requirements upgrades
|
||||
:: This is intended for users who want to start the API and have everything upgraded and installed
|
||||
|
||||
:: cd to the parent directory
|
||||
cd "%~dp0.."
|
||||
|
||||
:: Don't create a venv if a conda environment is active
|
||||
if exist "%CONDA_PREFIX%" (
|
||||
echo It looks like you're in a conda environment. Skipping venv check.
|
||||
) else (
|
||||
if not exist "venv\" (
|
||||
echo Venv doesn't exist! Please run start.bat instead.
|
||||
exit 0
|
||||
)
|
||||
|
||||
call .\venv\Scripts\activate.bat
|
||||
)
|
||||
|
||||
:: Call the python script with batch args
|
||||
call python start.py --update-deps --update-repository %*
|
||||
|
||||
pause
|
||||
19
update_scripts/update_deps_and_pull.sh
Normal file
19
update_scripts/update_deps_and_pull.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")/.." || exit
|
||||
|
||||
if [ -n "$CONDA_PREFIX" ]; then
|
||||
echo "It looks like you're in a conda environment. Skipping venv check."
|
||||
else
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "Venv doesn't exist! Please run start.sh instead."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Activating venv"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
source venv/bin/activate
|
||||
fi
|
||||
|
||||
python3 start.py --update-deps --update-repository "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue