initial python3 template

This commit is contained in:
Barak Michener 2018-09-06 00:28:19 -07:00
commit 534c1b3ea8
11 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,15 @@
*~
*.pyc
*.pyo
*.pyt
*.pytc
*.egg-info
.*.swp
.DS_Store
venv/
venv3/
.cache/
build/
.idea/
.coverage
.mypy_cache

View file

@ -0,0 +1,8 @@
# pytest cache directory #
This directory contains data from the pytest's cache plugin,
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.
**Do not** commit this to version control.
See [the docs](https://docs.pytest.org/en/latest/cache.html) for more information.

View file

@ -0,0 +1,3 @@
[
"tests/test_true.py::test_true"
]

View file

@ -0,0 +1,22 @@
all: default
default: clean deps test lint
venv:
if [ ! -e "venv/bin/activate_this.py" ] ; then virtualenv --python=python3 venv ; fi
clean:
find . -name \*.pyc -delete
find . -name __pycache__ -delete
rm -rf dist/
test_unit: venv
. venv/bin/activate && python3 -bb -m pytest tests
lint: venv
. venv/bin/activate && flake8 .
deps: venv
. venv/bin/activate && pip install -U -r requirements.txt
test: test_unit lint

View file

@ -0,0 +1,3 @@
pytest
flake8
pip

View file

@ -0,0 +1,28 @@
[flake8]
format = pylint
exclude = .svc,CVS,.bzr,.hg,.git,__pycache__,venv
max-complexity = 10
max-line-length = 120
ignore = NONE
[pep8]
max-line-length = 120
[tool:pytest]
addopts = --cov={{cookiecutter.project_name}} --cov-fail-under=80 --cov-report=term-missing:skip-covered --cov-report=xml --cov-report=html -vvv
[coverage:run]
branch = True
#omit =
[coverage:xml]
output = build/coverage.xml
[coverage:html]
directory = build/coverage_html
[mypy]
disallow_untyped_defs = True
ignore_missing_imports = True
strict_optional = True
warn_no_return = True

View file

@ -0,0 +1,22 @@
from setuptools import setup, find_packages
__version__ = '0.1.1'
setup(
name='{{cookiecutter.project_name}}',
version=__version__,
description='{{cookiecutter.project_description}}',
#url='',
maintainer='{{cookiecutter.real_name}}',
maintainer_email='{{cookiecutter.email}}',
packages=find_packages(exclude=['tests*']),
dependency_links=[],
install_requires=[
# e.g.
# Python FooBar package for foobaring
# pyfoobar>=1.0, <2.0
],
extras_require={
},
)

View file

@ -0,0 +1,6 @@
# import pytest
# from mock import MagicMock
def test_true():
assert True == True