Skip to content

x2x4com/inspinia

Repository files navigation

inspinia

Build Status GitHub release Requires.io Codecov GitHub issues license


Install

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.


Setting Up The Database

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

Creating A Database Revision

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

Running The Flask App

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

Configuration

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 Targets

Makefile commands will only work inside a virtualenv or a condaenv

make init

Initializes the virtualenv with an up-to-date version of setuptools, pip, and pip-tools.

make install

Runs pip-compile with requirements-<current interpreter version>.in then runs pip-sync with requirements-<current interpreter version>.txt

make requirements-py2.txt

Runs pip-compile with requirements/python2.in to generate requirements-py2.txt

make install-requirements-py2.txt

Runs pip-compile with requirements/install-python2.in to generate install-requirements-py2.txt

make requirements-py3.txt

Runs pip-compile with requirements/python3.in to generate requirements-py3.txt

make install-requirements-py3.txt

Runs pip-compile with requirements/install-python3.in to generate install-requirements-py3.txt

make check

Runs the lint and test targets.

make lint

Runs pylint on all packages in the project directory.

make test

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.

make test-unit

Same as make test excluding coverage and tests marked as integration.

make test-integration

Same as make test excluding coverage and tests not marked as integration.

make build

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).

make clean

Cleans the project of compiled python files and files generated by the above commands such as build and dist directories.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published