diff --git a/.travis.yml b/.travis.yml index fb5eaa7828d6f5b01e426be9e43d238e21b7faa5..2afddbfe7771e29358f5785f4bee6c2072b058ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ before_script: script: - flake8 . --exclude '*/migrations,docs,static' --ignore E128 - py.test memopol representatives_positions representatives_recommendations -- rm -rf db.sqlite - django-admin migrate after_success: - codecov diff --git a/bin/quickstart.sh b/bin/quickstart.sh new file mode 100755 index 0000000000000000000000000000000000000000..4d92a5086ebfa6112fc337ed6b307bbf812f94b6 --- /dev/null +++ b/bin/quickstart.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# +# Quick-start script for new developers +# Usage: from repo root, `source bin/quickstart.sh` +# + +set -e + +REPOROOT=$(dirname $(dirname $0)) + +# Ensure we're at the root of the memopol repository +pushd $REPOROOT >/dev/null + +# Create & activate python virtual environment +virtualenv memopol_env +source memopol_env/bin/activate + +# Install python dependencies +pip install -e .[testing] + +# Install client dependencies +bin/install_client_deps.sh + +# Setup environment +export DJANGO_DEBUG=True +export DJANGO_SETTINGS_MODULE=memopol.settings + +# Run django migration to create database +./manage.py migrate + +# Import sample data +./manage.py loaddata memopol/fixtures/smaller_sample.json + +echo +echo "You're all set!" +echo "To start the application run the following from the repository root ($REPOROOT):" +echo " source memopol_env/bin/activate" +echo " export DJANGO_DEBUG=True DJANGO_SETTINGS_MODULE=memopol.settings" +echo " ./manage.py runserver" +echo +echo "If you make changes, don't forget to run tests using:" +echo " flake8 . --exclude '*/migrations,docs,static' --ignore E128" +echo " py.test memopol representatives_positions representatives_recommendations" +echo +echo "Happy hacking ;)" +echo + +popd >/dev/null diff --git a/db.sqlite b/db.sqlite deleted file mode 100644 index 5b47f483475a2c526116d555bb728cf73f00d841..0000000000000000000000000000000000000000 Binary files a/db.sqlite and /dev/null differ diff --git a/docs/development.rst b/docs/development.rst index 52ae5633fca6d5da3a549abb3f000d99a239525a..cad40a4f9ee6877db449354b8f5e97755b41110f 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -6,10 +6,23 @@ Local development tutorial decisions. This tutorial drives through a local installation of the project for -development on Linux. It requires git, a fairly recent version of nodejs (see -:file:`.openshift/action_hooks/deploy` for a way to install it), python2 and +development on Linux. It requires git, a fairly recent version of python2 and virtualenv. +Quickstart +========== + +You can skip the instructions below and just use the quickstart script. To do +so, first clone the repository, cd into the repository root and source the +quickstart script: + + $ git clone https://github.com/political-memory/political_memory.git + $ cd political_memory + $ source bin/quickstart.sh + +If you want more control, you can follow the steps below or have a look at what +the quickstart script does. + Make a virtual environment ==========================