Due to a pinned install requirements, it is recommended you use a virtualenv
git clone https://github.com/derek-miller/inspinia.git
cd inspinia
python setup.py install
This will install the bare minimum to get the app running in your current environment.
This project uses Postgres so make sure you have it installed first. Then you can setup the db using the following commands:
createdb inspinia
python -m inspinia.manage db upgrade
After making changes to the db models you can create a new version of the database using alembic:
python -m inspinia.manage db migrate -m "<short commit message>"
Review the migration file found in the inspinia/migrations/versions folder and make sure everything is correct, then run:
python -m inspinia.manage db upgrade
There are several ways to run the app, the easiest is to use the heroku toolbelt's local command with a .env.dev file for configuration:
heroku local -e env.dev
An alternative to using the heroku toolbelt is to use honcho:
honcho -e .env.dev start
Lastly you can manually run the application using your environment as your configuration:
python -m inspinia.main
# In a separate shell
celery worker -A inspinia.tasks
All configuration is contained in the environment. You can check the current settings with the fllowing command:
python -m inspinia.settings
Or retrieve a single setting:
python -m inspinia.settings <setting_name>
Makefile commands will only work inside a virtualenv or a condaenv
Initializes the virtualenv with an up-to-date version of setuptools, pip, and pip-tools.
Runs pip-compile with requirements-<current interpreter version>.in
then runs pip-sync with requirements-<current interpreter version>.txt
Runs pip-compile with requirements/python2.in to generate requirements-py2.txt
Runs pip-compile with requirements/install-python2.in to generate install-requirements-py2.txt
Runs pip-compile with requirements/python3.in to generate requirements-py3.txt
Runs pip-compile with requirements/install-python3.in to generate install-requirements-py3.txt
Runs the lint
and test
targets.
Runs pylint on all packages in the project directory.
Runs py.test tests located inside the tests/ folder and any test files nested in a package in the project directory. Coverage is only calculated in this target.
Same as make test
excluding coverage and tests marked as integration
.
Same as make test
excluding coverage and tests not marked as integration
.
Builds a wheel using setuptools' bdist_wheel command. In the travis build environment the wheel is tagged with the build number (ex. 0.1.0+build1).
Cleans the project of compiled python files and files generated by the above commands such as build and dist directories.