Skip to content

Commit b75d028

Browse files
committed
Initial commit. Check rest of the files
0 parents  commit b75d028

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2504
-0
lines changed

.coveragerc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# .coveragerc to control coverage.py
2+
[run]
3+
branch = True
4+
source = app/
5+
omit =
6+
*__init__.py
7+
8+
[report]
9+
show_missing = True
10+
11+
# Regexes for lines to exclude from consideration
12+
exclude_lines =
13+
# Don't report non-runnable code
14+
if 0:
15+
if __name__ == .__main__.:
16+
pass
17+
pragma: no cover
18+
# use "pragma: no cover" as comment to ignore code
19+
20+
[html]
21+
directory = tests/coverage_html

.gitignore

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
.env
2+
app.db
3+
aws_keys.yml
4+
hosts
5+
logs/
6+
7+
# Byte-compiled / optimized / DLL files
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
12+
# C extensions
13+
*.so
14+
15+
# Distribution / packaging
16+
.Python
17+
build/
18+
develop-eggs/
19+
dist/
20+
downloads/
21+
eggs/
22+
.eggs/
23+
lib/
24+
lib64/
25+
parts/
26+
sdist/
27+
var/
28+
wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
.hypothesis/
54+
.pytest_cache/
55+
56+
# Translations
57+
*.mo
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# pyenv
82+
.python-version
83+
84+
# celery beat schedule file
85+
celerybeat-schedule
86+
87+
# SageMath parsed files
88+
*.sage.py
89+
90+
# Environments
91+
.env
92+
.venv
93+
env/
94+
venv/
95+
ENV/
96+
env.bak/
97+
venv.bak/
98+
99+
# Spyder project settings
100+
.spyderproject
101+
.spyproject
102+
103+
# Rope project settings
104+
.ropeproject
105+
106+
# mkdocs documentation
107+
/site
108+
109+
# mypy
110+
.mypy_cache/

.pylintrc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[MASTER]
2+
3+
#init-hook='import sys; import os; sys.path.append(os.getcwd() + "/example/hello_world")'
4+
5+
[MESSAGES CONTROL]
6+
7+
#disable=superfluous-parens,anomalous-backslash-in-string,bad-builtin,invalid-name
8+
disable=duplicate-code,W0105,W0141,C0103,R0903,F0401,R0912,R0914,R0915,E0611,E1101,E1103,W0122,C0303,broad-except,global-statement,too-many-instance-attributes,no-self-use,superfluous-parens,locally-disabled,locally-enabled
9+
10+
11+
[FORMAT]
12+
13+
# Maximum number of characters on a single line.
14+
max-line-length=120
15+
16+
# Maximum number of lines in a module
17+
#max-module-lines=1000
18+
max-module-lines=5000
19+
20+
21+
[REPORTS]
22+
23+
reports=no
24+
#include-ids=yes

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

Makefile

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
#!/usr/bin/env make -f
2+
#
3+
# Makefile for recipe static site generator
4+
#
5+
6+
# ---------------------------------------------------------------------------
7+
#
8+
# General setup
9+
#
10+
11+
# Set default target
12+
.DEFAULT_GOAL := test
13+
14+
# Decide if use python3 or python
15+
ifeq (, $(@shell which python3))
16+
py = python3
17+
else
18+
py = python
19+
endif
20+
# Decide if use pip3 or pip
21+
ifeq (, $(@shell which pip3))
22+
pip = pip3
23+
else
24+
pip = pip
25+
endif
26+
# Decide if use firefox or firefox.exe
27+
ifeq (, $(@shell which firefox.exe))
28+
browser = firefox.exe
29+
else
30+
browser = firefox
31+
endif
32+
33+
34+
# Detect OS
35+
OS = $(shell uname -s)
36+
37+
# Defaults
38+
ECHO = echo
39+
40+
# Make adjustments based on OS
41+
ifneq (, $(findstring CYGWIN, $(OS)))
42+
ECHO = /bin/echo -e
43+
endif
44+
45+
# Colors and helptext
46+
NO_COLOR = \033[0m
47+
ACTION = \033[32;01m
48+
OK_COLOR = \033[32;01m
49+
ERROR_COLOR = \033[31;01m
50+
WARN_COLOR = \033[33;01m
51+
52+
# Which makefile am I in?
53+
WHERE-AM-I = $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
54+
THIS_MAKEFILE := $(call WHERE-AM-I)
55+
56+
# Echo some nice helptext based on the target comment
57+
HELPTEXT = $(ECHO) "$(ACTION)--->" `egrep "^\# target: $(1) " $(THIS_MAKEFILE) | sed "s/\# target: $(1)[ ]*-[ ]* / /g"` "$(NO_COLOR)"
58+
59+
60+
61+
# ----------------------------------------------------------------------------
62+
#
63+
# Highlevel targets
64+
#
65+
# target: help - Displays help with targets available.
66+
.PHONY: help
67+
help:
68+
@$(call HELPTEXT,$@)
69+
@echo "Usage:"
70+
@echo " make [target] ..."
71+
@echo "target:"
72+
@egrep "^# target:" Makefile | sed 's/# target: / /g'
73+
74+
75+
76+
# target: info - Displays versions.
77+
.PHONY: info
78+
info:
79+
@${py} --version
80+
@${py} -m pip --version
81+
#@virtualenv --version
82+
83+
84+
85+
# target: validate - Validate code with pylint
86+
.PHONY: validate
87+
validate:
88+
@pylint --rcfile=.pylintrc app tests
89+
90+
91+
92+
# target: test-integration - Run tests in tests/integration with coverage.py
93+
.PHONY: test-integration
94+
test-integration: clean
95+
@$(ECHO) "$(ACTION)---> Running all tests in tests/integration" "$(NO_COLOR)"
96+
@${py} \
97+
-m coverage run --rcfile=.coveragerc \
98+
-m py.test -c pytest.ini tests/integration
99+
$(MAKE) clean-py
100+
101+
102+
103+
# target: test-unit - Run tests in tests/unit with coverage.py
104+
.PHONY: test-unit
105+
test-unit: clean
106+
@$(ECHO) "$(ACTION)---> Running all tests in tests/unit" "$(NO_COLOR)"
107+
@${py} \
108+
-m coverage run --rcfile=.coveragerc \
109+
-m py.test -c pytest.ini tests/unit
110+
$(MAKE) clean-py
111+
112+
113+
114+
# target: run-test test=test-file.py - Run one test file
115+
.PHONY: run-test
116+
run-test:
117+
@${py} \
118+
-m pytest --pylint --pylint-rcfile=.pylintrc $(test)
119+
120+
121+
122+
## target: exec-tests - Run all tests in tests/ with coverage.py
123+
.PHONY: exec-tests
124+
exec-tests: test-unit test-integration
125+
126+
127+
128+
# target: test - Run tests and display code coverage
129+
.PHONY: test
130+
test: validate exec-tests
131+
${py} -m coverage report --rcfile=.coveragerc
132+
$(MAKE) clean-cov
133+
134+
135+
136+
## target: test-html - Run tests and display detailed code coverage with html
137+
.PHONY: test-html
138+
test-html: exec-tests
139+
${py} -m coverage html --rcfile=.coveragerc && ${browser} tests/coverage_html/index.html &
140+
141+
142+
143+
## target: clean-py - Remove generated python files
144+
.PHONY: clean-py
145+
clean-py:
146+
find . -name '*.pyc' -exec rm -f {} +
147+
find . -name '*.pyo' -exec rm -f {} +
148+
find . -name '__pycache__' -exec rm -fr {} +
149+
find . -name '.pytest_cache' -exec rm -fr {} +
150+
151+
152+
153+
## target: clean-cov - Remove generated coverage files
154+
.PHONY: clean-cov
155+
clean-cov:
156+
rm -f .coverage
157+
rm -rf tests/coverage_html
158+
159+
160+
161+
# target: clean - Remove all generated files
162+
.PHONY: clean
163+
clean: clean-py clean-cov
164+
find . -name '*~' -exec rm -f {} +
165+
find . -name '*.log*' -exec rm -fr {} +
166+
167+
168+
169+
# target: install - Install all Python packages specified in requirement.txt (requirements/prod.txt)
170+
.PHONY: install
171+
install:
172+
${pip} install -r requirements.txt
173+
174+
175+
176+
# target: install-dev - Install all Python packages specified in requirements/*
177+
.PHONY: install-dev
178+
install-dev:
179+
${pip} install -r requirements/dev.txt
180+
181+
182+
183+
# target: install-test - Install all Python packages specified in requirements/{test.txt, prod.txt}
184+
.PHONY: install-test
185+
install-test:
186+
${pip} install -r requirements/test.txt
187+
188+
189+
190+
# target: install-deploy - Install all Python packages specified in requirements/{deploy.txt}
191+
.PHONY: install-deploy
192+
install-deploy:
193+
${pip} install -r requirements/deploy.txt
194+

0 commit comments

Comments
 (0)