diff --git a/deployment/README.md b/deployment/README.md index d6158a4..1b5e55b 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -34,6 +34,7 @@ Arguments: Virtual Environments: rmenv py# Remove virtual environment remkenv py# Remove, then create re-create virtual environment + envprereq py# install environment prerequisites (official PyPi) Deploy: deploy test Upload to PyPi test server @@ -98,11 +99,13 @@ password=secret ``` # Python 2.x ./deploy.sh remkenv py2 +./deploy.sh envprereq py2 ./deploy.sh install sdist py2 ./deploy.sh test installed py2 # Python 3.x ./deploy.sh remkenv py3 +./deploy.sh envprereq py3 ./deploy.sh install sdist py3 ./deploy.sh test installed py3 ``` diff --git a/deployment/deploy.sh b/deployment/deploy.sh index 0a254aa..008bbee 100755 --- a/deployment/deploy.sh +++ b/deployment/deploy.sh @@ -13,6 +13,12 @@ function lib_ver() { 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 LIB_NAME=pygcode LIB_VER=$(lib_ver) @@ -38,6 +44,7 @@ Arguments: Virtual Environments: rmenv py# Remove virtual environment remkenv py# Remove, then create re-create virtual environment + envprereq py# install environment prerequisites (official PyPi) Deploy: deploy test Upload to PyPi test server @@ -89,6 +96,13 @@ function remkenv() { mkvirtualenv --python=${python_bin} ${env_name} } +function envprereq() { + set_venv_variables $1 + workon ${env_name} + ${env_pip_bin} install $(lib_prereq) + deactivate +} + function deploy() { # Deploy compiled distributions to the test|prod server _deployment_env=$1 @@ -198,6 +212,7 @@ case "$1" in build) build ;; rmenv) rmenv $2 ;; remkenv) remkenv $2 ;; + envprereq) envprereq $2 ;; deploy) deploy $2 ;; install) install $2 $3 ;; test) run_test $2 $3 ;;