Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danmilon committed Jul 9, 2016
1 parent 9d0f26b commit a25be67
Show file tree
Hide file tree
Showing 44 changed files with 73 additions and 1,831 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
venv
34 changes: 12 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@
CSA_ENVIRONMENT ?= production
CSA_INI_CONFIG = ${CSA_ENVIRONMENT}.ini
SOURCE_FOLDERS = csa pyque mrsmith
SOURCE_FOLDERS = csa

.PHONY: deps docs initdb venv
.PHONY: deps

all: venv deps setup
all: venv deps

deps: venv requirements.txt
deps: venv
. venv/bin/activate && python -m pip install wheel
. venv/bin/activate && python -m pip wheel -r requirements.txt
. venv/bin/activate && python -m pip install -r requirements.txt

venv:
virtualenv -p python3 venv --prompt '(csa)'

setup:
. venv/bin/activate && python setup.py develop

test:
. venv/bin/activate && python -m unittest -v ${TEST_ARGS}

initdb:
. venv/bin/activate && alembic -c ${CSA_INI_CONFIG} downgrade base
. venv/bin/activate && alembic -c ${CSA_INI_CONFIG} upgrade head
. venv/bin/activate && csa/scripts/initdb --init --insert-test-data ${CSA_INI_CONFIG}

run: all
. venv/bin/activate && pserve ${CSA_INI_CONFIG}
db-init:
. venv/bin/activate && \
python -c 'from csa.app import db; db.create_all()'

docs:
SPHINX_APIDOC_OPTIONS="members,special-members,show-inheritance" \
. venv/bin/activate && sphinx-apidoc -f -o docs csa
. venv/bin/activate && cd docs && make html
db-clean:
. venv/bin/activate && \
python -c 'from csa.app import db; db.drop_all()'

pep8:
. venv/bin/activate && pep8 --max-line-length=120 ${SOURCE_FOLDERS}
. venv/bin/activate && pep8 ${SOURCE_FOLDERS}

autopep8:
. venv/bin/activate && \
find ${SOURCE_FOLDERS} -name "*.py" | \
xargs autopep8 --max-line-length 120 -j 0 --in-place

clean:
rm -rf venv open_csa.egg-info
rm -rf venv
17 changes: 15 additions & 2 deletions csa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# -*- coding: utf-8 -*-
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bootstrap import Bootstrap

from csa.app import create_app
app = Flask(__name__)
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
app.config['SQLALCHEMY_ECHO'] = True
db = SQLAlchemy(app)
Bootstrap(app)

# import views to be registered
import csa.views

# import models to be registered
import csa.models
3 changes: 0 additions & 3 deletions csa/api/__init__.py

This file was deleted.

41 changes: 0 additions & 41 deletions csa/api/views.py

This file was deleted.

152 changes: 0 additions & 152 deletions csa/app.py

This file was deleted.

62 changes: 0 additions & 62 deletions csa/config.py

This file was deleted.

Loading

0 comments on commit a25be67

Please sign in to comment.