Created
January 23, 2018 07:15
-
-
Save SamuelMarks/6555ca996ce11787515af25f1d2d2a83 to your computer and use it in GitHub Desktop.
[offscale] Install all dependencies via pip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ ! -z DIR ]; then DIR=(off*/); fi | |
VENV="${VENV:-.offenv}" | |
REQUIREMENTS="${REQUIREMENTS:-'requirements.txt'}"; | |
if [ ! -d "$VENV/bin" ]; then | |
echo Cannot find "$VENV/bin" | |
exit 2; | |
fi | |
source "$VENV/bin/activate" | |
for f in "${DIR[@]}"; do | |
if [ -f "$f/setup.py" ]; then | |
builtin cd "$f"; | |
pip uninstall -y "${PWD##*/}"; | |
if [ -f "$REQUIREMENTS" ]; then | |
pip install -r "$REQUIREMENTS" | |
fi | |
pip install .; | |
builtin cd ..; | |
fi; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Note: this hasn't been tested, so comments/testing are very welcome! | |
if "%VENV%"=="" ("%VENV%\Scripts\activate") | |
if "%REQUIREMENTS%"=="" (set REQUIREMENTS="requirements.txt") | |
:: TODO: Handle failure on no existent %REQUIREMENTS% and on no setup.py | |
for /d %%i in (*.*) do cd %%i & pip install & pip install -r %REQUIREMENTS% & cd.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment