-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
73 additions
and
1,831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.