-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moving tests/ somewhere standard. adding TravisCI'
- Loading branch information
Jonathon Belotti
committed
Apr 22, 2017
1 parent
97e6c0f
commit 7d6dbca
Showing
9 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
language: python | ||
python: | ||
- "3.5" | ||
install: | ||
- pip install -r requirements.txt | ||
branches: | ||
only: [master] | ||
# command to run tests | ||
script: | ||
- nosetests |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash -e | ||
# Create or replace the app's python virtual environment and installs all the packages required for the app. | ||
# | ||
# Usage: | ||
# | ||
# ./install_package.sh | ||
|
||
|
||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
VIRTUAL_ENV_PATH="${VIRTUAL_ENV_PATH:=${script_dir}/virtual_env}" | ||
|
||
requirements_pip_file="${REQUIREMENTS_PIP_FILE:-requirements.txt}" | ||
|
||
# Create or replace python virtual environment | ||
echo "Creating/Replacing VirtualEnv" | ||
rm -rf $VIRTUAL_ENV_PATH | ||
mkdir -p "${VIRTUAL_ENV_PATH}" 2>/dev/null | ||
|
||
if PYTHON3_PATH=$(which python3); then | ||
virtualenv --python=$PYTHON3_PATH $VIRTUAL_ENV_PATH | ||
else | ||
echo "Could not find Python 3 on system. Please install it." | ||
exit 1 | ||
fi | ||
|
||
# Install the package and its dependencies | ||
echo "Installing pip requirement file: ${requirements_pip_file}" | ||
./run_in_venv.sh pip install -r "${requirements_pip_file}" | ||
|
||
echo "Setup.py Installing" | ||
./run_in_venv.sh python setup.py install |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
nose | ||
pytest |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Runs any command in the application's python virtual environment. This script assumes | ||
# the environment has been installed using install_miniconda.sh and | ||
# install_app.sh. | ||
# | ||
# Usage: | ||
# ./run_in_environment.sh python setup.py test | ||
# | ||
# You can also use it to activate the virtual environment, e.g.: | ||
# source run_in_environment.sh | ||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
VIRTUAL_ENV_PATH="${VIRTUAL_ENV_PATH:=${script_dir}/virtual_env}" | ||
ACTIVATE_FILE="${VIRTUAL_ENV_PATH}/bin/activate" | ||
|
||
# Get out of currently activate venvs, if any | ||
if [[ $VIRTUAL_ENV ]]; then | ||
deactivate 2> /dev/null | ||
fi | ||
|
||
if [ -f $ACTIVATE_FILE ]; then | ||
source $ACTIVATE_FILE | ||
exec "$@" | ||
else | ||
echo "Error: the file $ACTIVATE_FILE does not exist. Please install the environment correctly." | ||
# Only exit if you're not in an interactive session | ||
if [[ $- != *"i"* ]] ; then exit 1 ; fi | ||
fi |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.