Merge pull request #15 from dod-ccpo/virtual-env-fixup

Virtual env fixup
This commit is contained in:
Devon 2018-05-30 15:54:29 -04:00 committed by GitHub
commit 552022af97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 7 deletions

3
.gitignore vendored
View File

@ -6,3 +6,6 @@ scss/assets
.pytest_cache/
.venv/
__pycache__
# Ignore static/fonts for now, since it is just symlink
static/fonts

View File

@ -7,11 +7,17 @@
./script/setup
The setup script will create a new Python virtual environment for the application to use. All of the scripts will activate this virutal envirnment automatically, but you can also manually activate it like this:
source .venv/bin/activate
If you want to automatically load the virtual environment whenever you enter the project directory, take a look at [direnv](https://direnv.net/)
## Running (development)
To start the app and watch for changes:
DEBUG=1 ./app.py
DEBUG=1 ./script/server
## Testing

View File

@ -4,7 +4,10 @@
set -e
# Ensure we are in the app root directory (not the /script directory)
cd "$(dirname "$0")/.."
cd "$(dirname "${0}")/.."
# Activate virtual environment
source .venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt

View File

@ -4,7 +4,10 @@
set -e
# Ensure we are in the app root directory (not the /script directory)
cd "$(dirname "$0")/.."
cd "$(dirname "${0}")/.."
# Activate virtual environment
source .venv/bin/activate
# Launch the app
python3 app.py
python3 app.py ${@}

View File

@ -4,7 +4,7 @@
set -e
# Ensure we are in the app root directory (not the /script directory)
cd "$(dirname "$0")/.."
cd "$(dirname "${0}")/.."
# Install virtualenv
pip install virtualenv

View File

@ -4,7 +4,10 @@
set -e
# Ensure we are in the app root directory (not the /script directory)
cd "$(dirname "$0")/.."
cd "$(dirname "${0}")/.."
# Activate virtual environment
source .venv/bin/activate
# Run unit tests
python3 -m pytest

View File

@ -4,7 +4,10 @@
set -e
# Ensure we are in the app root directory (not the /script directory)
cd "$(dirname "$0")/.."
cd "$(dirname "${0}")/.."
# Activate virtual environment
source .venv/bin/activate
# Update dependencies
script/bootstrap