Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 2e4b4e9

Browse files
committed
Walking skeleton for fiaas-ais
1 parent 98dd718 commit 2e4b4e9

10 files changed

+355
-0
lines changed

.gitignore

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Linux template
3+
*~
4+
5+
# temporary files which can be created if a process still has a handle open of a deleted file
6+
.fuse_hidden*
7+
8+
# KDE directory preferences
9+
.directory
10+
11+
# Linux trash folder which might appear on any partition or disk
12+
.Trash-*
13+
14+
# .nfs files are created when an open file is removed but is still being accessed
15+
.nfs*
16+
### Python template
17+
# Byte-compiled / optimized / DLL files
18+
__pycache__/
19+
*.py[cod]
20+
*$py.class
21+
22+
# C extensions
23+
*.so
24+
25+
# Distribution / packaging
26+
.Python
27+
build/
28+
develop-eggs/
29+
dist/
30+
downloads/
31+
eggs/
32+
.eggs/
33+
lib/
34+
lib64/
35+
parts/
36+
sdist/
37+
var/
38+
wheels/
39+
*.egg-info/
40+
.installed.cfg
41+
*.egg
42+
MANIFEST
43+
44+
# PyInstaller
45+
# Usually these files are written by a python script from a template
46+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
47+
*.manifest
48+
*.spec
49+
50+
# Installer logs
51+
pip-log.txt
52+
pip-delete-this-directory.txt
53+
54+
# Unit test / coverage reports
55+
htmlcov/
56+
.tox/
57+
.coverage
58+
.coverage.*
59+
.cache
60+
nosetests.xml
61+
coverage.xml
62+
*.cover
63+
.hypothesis/
64+
65+
# Translations
66+
*.mo
67+
*.pot
68+
69+
# Django stuff:
70+
*.log
71+
.static_storage/
72+
.media/
73+
local_settings.py
74+
75+
# Flask stuff:
76+
instance/
77+
.webassets-cache
78+
79+
# Scrapy stuff:
80+
.scrapy
81+
82+
# Sphinx documentation
83+
docs/_build/
84+
85+
# PyBuilder
86+
target/
87+
88+
# Jupyter Notebook
89+
.ipynb_checkpoints
90+
91+
# pyenv
92+
.python-version
93+
94+
# celery beat schedule file
95+
celerybeat-schedule
96+
97+
# SageMath parsed files
98+
*.sage.py
99+
100+
# Environments
101+
.env
102+
.venv
103+
env/
104+
venv/
105+
ENV/
106+
env.bak/
107+
venv.bak/
108+
109+
# Spyder project settings
110+
.spyderproject
111+
.spyproject
112+
113+
# Rope project settings
114+
.ropeproject
115+
116+
# mkdocs documentation
117+
/site
118+
119+
# mypy
120+
.mypy_cache/
121+
### Windows template
122+
# Windows thumbnail cache files
123+
Thumbs.db
124+
ehthumbs.db
125+
ehthumbs_vista.db
126+
127+
# Dump file
128+
*.stackdump
129+
130+
# Folder config file
131+
[Dd]esktop.ini
132+
133+
# Recycle Bin used on file shares
134+
$RECYCLE.BIN/
135+
136+
# Windows Installer files
137+
*.cab
138+
*.msi
139+
*.msm
140+
*.msp
141+
142+
# Windows shortcuts
143+
*.lnk
144+
### macOS template
145+
# General
146+
.DS_Store
147+
.AppleDouble
148+
.LSOverride
149+
150+
# Icon must end with two \r
151+
Icon
152+
153+
# Thumbnails
154+
._*
155+
156+
# Files that might appear in the root of a volume
157+
.DocumentRevisions-V100
158+
.fseventsd
159+
.Spotlight-V100
160+
.TemporaryItems
161+
.Trashes
162+
.VolumeIcon.icns
163+
.com.apple.timemachine.donotpresent
164+
165+
# Directories potentially created on remote AFP share
166+
.AppleDB
167+
.AppleDesktop
168+
Network Trash Folder
169+
Temporary Items
170+
.apdisk
171+
### JetBrains template
172+
.idea
173+
174+
## File-based project format:
175+
*.iws
176+
*.iml
177+
178+
## Plugin-specific files:
179+
180+
# IntelliJ
181+
out/
182+
183+
# mpeltonen/sbt-idea plugin
184+
.idea_modules/
185+
186+
# JIRA plugin
187+
atlassian-ide-plugin.xml
188+
189+
# Cursive Clojure plugin
190+
.idea/replstate.xml
191+
192+
# Crashlytics plugin (for Android Studio and IntelliJ)
193+
com_crashlytics_export_strings.xml
194+
crashlytics.properties
195+
crashlytics-build.properties
196+
fabric.properties
197+

.prospector.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
strictness: high
2+
test-warnings: true
3+
doc-warnings: false
4+
5+
ignore-paths:
6+
- build
7+
- .git
8+
- __pycache__
9+
- .eggs
10+
- dist
11+
- .tox
12+
- .cachedocs
13+
14+
pep8:
15+
options:
16+
max-line-length: 120
17+
18+
mccabe:
19+
max-complexity: 10
20+
21+
# TODO: Figure out how to replace the functionality provided by:
22+
# flake8-comprehensions and flake8-print
23+
24+
pylint:
25+
run: false
26+
27+
pyroma:
28+
run: false
29+
30+
frosted:
31+
run: false
32+
33+
vulture:
34+
run: false
35+
36+
pep257:
37+
run: false

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: python
2+
python:
3+
- '3.6'
4+
cache: pip
5+
script: py.test

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
AIS
2+
---
3+
4+
[![Build Status](https://travis-ci.org/fiaas/ais.svg?branch=master)](https://travis-ci.org/fiaas/ais)
5+
6+
7+
AIS manages the publication of release channel metadata for FIAAS components
8+

ais.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from flask import Flask
2+
3+
app = Flask(__name__)
4+
5+
6+
@app.route('/')
7+
def hello_world():
8+
return 'Hello World!'
9+
10+
11+
def main():
12+
app.run()
13+
14+
15+
if __name__ == '__main__':
16+
main()

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-e .[dev]

setup.cfg

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[aliases]
2+
test=pytest
3+
4+
[tool:pytest]
5+
addopts = --junitxml=build/reports/tests/junit.xml --cov=ais --cov-report html --cov-report term --cov-report xml
6+
7+
[coverage:html]
8+
directory=build/reports/coverage
9+
10+
[coverage:xml]
11+
output=build/reports/coverage.xml

setup.py

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from datetime import datetime
2+
from subprocess import check_output, CalledProcessError
3+
4+
from setuptools import setup, find_packages
5+
from warnings import warn
6+
7+
8+
def version():
9+
date_string = datetime.now().strftime("1.%Y%m%d.%H%M%S")
10+
try:
11+
git_sha = check_output(["git", "describe", "--always", "--dirty=dirty", "--match=NOTHING"]).strip().decode()
12+
return "{}+{}".format(date_string, git_sha)
13+
except CalledProcessError as e:
14+
warn("Error calling git: {}".format(e))
15+
return date_string
16+
17+
18+
GENERIC_REQ = [
19+
"Flask==0.12.2",
20+
]
21+
22+
CODE_QUALITY_REQ = [
23+
'prospector',
24+
]
25+
26+
TESTS_REQ = [
27+
'tox==2.9.1',
28+
'pytest-html',
29+
'pytest-cov',
30+
'pytest-helpers-namespace',
31+
'pytest >= 3.0',
32+
]
33+
34+
setup(
35+
name="fiaas-ais",
36+
url="https://github.com/fiaas/ais",
37+
author="FIAAS developers",
38+
author_email="[email protected]",
39+
version=version(),
40+
packages=find_packages(exclude=("tests",)),
41+
zip_safe=True,
42+
# Requirements
43+
install_requires=GENERIC_REQ,
44+
setup_requires=['pytest-runner', 'wheel', 'setuptools_scm'],
45+
extras_require={
46+
"dev": TESTS_REQ + CODE_QUALITY_REQ,
47+
},
48+
tests_require=TESTS_REQ,
49+
entry_points={"console_scripts": ['ais=ais:main']},
50+
)

tests/test_dummy.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8
3+
4+
import ais
5+
6+
7+
def test_dummy():
8+
assert ais.hello_world() == "Hello World!"

tox.ini

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tox]
2+
envlist = py34,py35,py36
3+
skip_missing_interpreters=True
4+
5+
[testenv]
6+
usedevelop=True
7+
deps=-rrequirements.txt
8+
setenv =
9+
TMP = {envtmpdir}
10+
passenv =
11+
HOME
12+
commands=prospector
13+
py.test
14+
15+
[testenv:coverage]
16+
usedevelop=True
17+
deps=.[dev,codacy]
18+
passenv =
19+
HOME
20+
CODACY_PROJECT_TOKEN
21+
commands=py.test
22+
python-codacy-coverage -r ./build/reports/coverage.xml

0 commit comments

Comments
 (0)