initial python3 template
This commit is contained in:
commit
534c1b3ea8
11 changed files with 113 additions and 0 deletions
15
python3/{{cookiecutter.project_name}}/.gitignore
vendored
Normal file
15
python3/{{cookiecutter.project_name}}/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
*~
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.pyt
|
||||
*.pytc
|
||||
*.egg-info
|
||||
.*.swp
|
||||
.DS_Store
|
||||
venv/
|
||||
venv3/
|
||||
.cache/
|
||||
build/
|
||||
.idea/
|
||||
.coverage
|
||||
.mypy_cache
|
||||
|
|
@ -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.
|
||||
3
python3/{{cookiecutter.project_name}}/.pytest_cache/v/cache/nodeids
vendored
Normal file
3
python3/{{cookiecutter.project_name}}/.pytest_cache/v/cache/nodeids
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[
|
||||
"tests/test_true.py::test_true"
|
||||
]
|
||||
22
python3/{{cookiecutter.project_name}}/Makefile
Normal file
22
python3/{{cookiecutter.project_name}}/Makefile
Normal 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
|
||||
3
python3/{{cookiecutter.project_name}}/requirements.txt
Normal file
3
python3/{{cookiecutter.project_name}}/requirements.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pytest
|
||||
flake8
|
||||
pip
|
||||
28
python3/{{cookiecutter.project_name}}/setup.cfg
Normal file
28
python3/{{cookiecutter.project_name}}/setup.cfg
Normal 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
|
||||
22
python3/{{cookiecutter.project_name}}/setup.py
Normal file
22
python3/{{cookiecutter.project_name}}/setup.py
Normal 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={
|
||||
},
|
||||
)
|
||||
0
python3/{{cookiecutter.project_name}}/tests/__init__.py
Normal file
0
python3/{{cookiecutter.project_name}}/tests/__init__.py
Normal file
6
python3/{{cookiecutter.project_name}}/tests/test_true.py
Normal file
6
python3/{{cookiecutter.project_name}}/tests/test_true.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# import pytest
|
||||
# from mock import MagicMock
|
||||
|
||||
|
||||
def test_true():
|
||||
assert True == True
|
||||
Loading…
Add table
Add a link
Reference in a new issue