Skip to content

skasberger/owat_api

Repository files navigation

Build Status Coverage Status Documentation Status GitHub Code style: black

Offene Wahlen AT API

Developed by Stefan Kasberger.

Features

Copyright

  • Code: License: MIT
  • Documentation: License: CC BY 4.0

SETUP

This instructions are to setup the development environment, which is also the default environment.

Prerequisites

Initialize database

Upgrade database

Config

OW AT API

Download App

Get the app on your computer, into your webservers directory (e. g. vhost).

Install requirements

Start the virtual environment to install the needed python packages.

pip install -r requirements.txt

Set environment variables

Run

Run the flask app:

Development

Install

cd /PATH/TO/VHOST
git clone https://github.com/skasberger/owat_api.git
cd owat_api
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements/development.txt
pre-commit install

Database Migration

After changing your SQLAlchemy models, you have to update your database. To add information about your changes, exchange "COMMENT" with your commit message.

flask db migrate -m "COMMENT"
flask db upgrade

Testing

To execute the tests, set the application mode and unset database URI.

tox

To execute the tests with tox (as recommended), simply type:

tox

You can find out more about the tox configuration inside tox.ini and in its documentation.

Coverage

To get test coverage of codebase, use coverage.

coverage run main.py
coverage report -m
coverage html

Run tests with coverage to create a html report as an output.

pytest --cov-report html --cov=app tests/

Coveralls

To use Coveralls on local development:

pytest tests/ --doctest-modules -v --cov=app

And to use Coveralls on Travis-CI

pytest tests/ --doctest-modules -v --cov coveralls --cov-report term-missing

Documentation

Use Sphinx to create class and function documentation out of the doc-strings.

tox -e docs

Releases

No releases published

Packages

No packages published

Languages