environment dependencies

This commit is contained in:
Peter Boin 2017-07-30 20:37:13 +10:00
parent 3e46bd636a
commit 41f7a46aaa
2 changed files with 18 additions and 0 deletions

View File

@ -34,6 +34,7 @@ Arguments:
Virtual Environments: Virtual Environments:
rmenv py# Remove virtual environment rmenv py# Remove virtual environment
remkenv py# Remove, then create re-create virtual environment remkenv py# Remove, then create re-create virtual environment
envprereq py# install environment prerequisites (official PyPi)
Deploy: Deploy:
deploy test Upload to PyPi test server deploy test Upload to PyPi test server
@ -98,11 +99,13 @@ password=secret
``` ```
# Python 2.x # Python 2.x
./deploy.sh remkenv py2 ./deploy.sh remkenv py2
./deploy.sh envprereq py2
./deploy.sh install sdist py2 ./deploy.sh install sdist py2
./deploy.sh test installed py2 ./deploy.sh test installed py2
# Python 3.x # Python 3.x
./deploy.sh remkenv py3 ./deploy.sh remkenv py3
./deploy.sh envprereq py3
./deploy.sh install sdist py3 ./deploy.sh install sdist py3
./deploy.sh test installed py3 ./deploy.sh test installed py3
``` ```

View File

@ -13,6 +13,12 @@ function lib_ver() {
popd > /dev/null popd > /dev/null
} }
function lib_prereq() {
pushd .. > /dev/null
python -c 'from setup import INSTALL_REQUIRES ; print(" ".join(INSTALL_REQUIRES))'
popd > /dev/null
}
# ============ Local Parameters # ============ Local Parameters
LIB_NAME=pygcode LIB_NAME=pygcode
LIB_VER=$(lib_ver) LIB_VER=$(lib_ver)
@ -38,6 +44,7 @@ Arguments:
Virtual Environments: Virtual Environments:
rmenv py# Remove virtual environment rmenv py# Remove virtual environment
remkenv py# Remove, then create re-create virtual environment remkenv py# Remove, then create re-create virtual environment
envprereq py# install environment prerequisites (official PyPi)
Deploy: Deploy:
deploy test Upload to PyPi test server deploy test Upload to PyPi test server
@ -89,6 +96,13 @@ function remkenv() {
mkvirtualenv --python=${python_bin} ${env_name} mkvirtualenv --python=${python_bin} ${env_name}
} }
function envprereq() {
set_venv_variables $1
workon ${env_name}
${env_pip_bin} install $(lib_prereq)
deactivate
}
function deploy() { function deploy() {
# Deploy compiled distributions to the test|prod server # Deploy compiled distributions to the test|prod server
_deployment_env=$1 _deployment_env=$1
@ -198,6 +212,7 @@ case "$1" in
build) build ;; build) build ;;
rmenv) rmenv $2 ;; rmenv) rmenv $2 ;;
remkenv) remkenv $2 ;; remkenv) remkenv $2 ;;
envprereq) envprereq $2 ;;
deploy) deploy $2 ;; deploy) deploy $2 ;;
install) install $2 $3 ;; install) install $2 $3 ;;
test) run_test $2 $3 ;; test) run_test $2 $3 ;;