docker venv fix (#4118)

* docker venv fix

- Run once with --upgrade-deps
- Required to ensure that setuptools is automatically upgraded

* Fix comment
This commit is contained in:
Oliver 2022-12-30 22:55:24 +11:00 committed by GitHub
parent a2643b34bf
commit faaed3dc14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,15 +30,18 @@ fi
# This should be done on the *mounted* filesystem,
# so that the installed modules persist!
if [[ -n "$INVENTREE_PY_ENV" ]]; then
echo "Using Python virtual environment: ${INVENTREE_PY_ENV}"
# Setup a virtual environment (within the "dev" directory)
python3 -m venv ${INVENTREE_PY_ENV} --system-site-packages
# Activate the virtual environment
if test -d "$INVENTREE_PY_ENV"; then
# venv already exists
echo "Using Python virtual environment: ${INVENTREE_PY_ENV}"
else
# Setup a virtual environment (within the "data/env" directory)
echo "Running first time setup for python environment"
python3 -m venv ${INVENTREE_PY_ENV} --system-site-packages --upgrade-deps
fi
# Now activate the venv
source ${INVENTREE_PY_ENV}/bin/activate
# Note: Python packages will have to be installed on first run
# e.g docker-compose run inventree-dev-server invoke update
fi
cd ${INVENTREE_HOME}