Skip to content

Commit

Permalink
Add package boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskuehl committed Feb 13, 2017
1 parent c993200 commit 23aa66b
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 0 deletions.
1 change: 1 addition & 0 deletions .activate.sh
30 changes: 30 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[run]
branch = True
source =
.
omit =
.tox/*
/usr/*
setup.py

[report]
show_missing = True
skip_covered = True

exclude_lines =
# Have to re-enable the standard pragma
\#\s*pragma: no cover

# Don't complain if tests don't hit defensive assertion code:
^\s*raise AssertionError\b
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
^\s*raise$

# Don't complain if non-runnable code isn't run:
^if __name__ == ['"]__main__['"]:$
[html]
directory = coverage-html
# vim:ft=dosini
1 change: 1 addition & 0 deletions .deactivate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deactivate
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.egg-info
*.py[co]
/.cache
/.coverage
/.tox
/.venv.touch
/.venv.tox.touch
/coverage-html
/dist
/venv
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: v0.7.1
hooks:
- id: trailing-whitespace
language_version: python3.5
- id: end-of-file-fixer
language_version: python3.5
exclude: ^\.activate\.sh$
- id: autopep8-wrapper
language_version: python3.5
- id: check-docstring-first
language_version: python3.5
- id: check-merge-conflict
language_version: python3.5
- id: check-yaml
language_version: python3.5
- id: debug-statements
language_version: python3.5
- id: double-quote-string-fixer
language_version: python3.5
- id: name-tests-test
language_version: python3.5
- id: flake8
language_version: python3.5
- id: check-added-large-files
language_version: python3.5
exclude: ^\.activate\.sh$
- id: check-byte-order-marker
language_version: python3.5
- id: fix-encoding-pragma
language_version: python3.5
- repo: https://github.com/asottile/reorder_python_imports
sha: v0.3.1
hooks:
- id: reorder-python-imports
language_version: python3.5
args: [
'--add-import', 'from __future__ import absolute_import',
'--add-import', 'from __future__ import unicode_literals',
]
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
REBUILD_FLAG =

.PHONY: minimal
minimal: venv

.PHONY: venv
venv: .venv.touch
tox -e venv $(REBUILD_FLAG)

.PHONY: test
test: .venv.tox.touch
tox $(REBUILD_FLAG)

.venv.touch .venv.tox.touch: setup.py requirements-dev.txt
$(eval REBUILD_FLAG := --recreate)
touch "$@"

.PHONY: clean
clean:
find -name '*.pyc' -delete
find -name '__pycache__' -delete
rm -rf .tox
rm -rf venv
rm -rf .venv.touch
rm -rf .venv.tox.touch
Empty file added identify/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage
pre-commit>=0.12.0
pytest
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[wheel]
universal = True
20 changes: 20 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals

from setuptools import find_packages
from setuptools import setup


setup(
name='identify',
version='0.0.0.dev1',
classifiers=[
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
install_requires=[],
packages=find_packages(exclude=('tests*', 'testing*')),
)
Empty file added tests/__init__.py
Empty file.
23 changes: 23 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[tox]
envlist = py27,py35

[testenv]
deps = -rrequirements-dev.txt
passenv = HOME SSH_AUTH_SOCK USER
commands =
coverage erase
coverage run -m pytest {posargs:tests}
coverage report --fail-under 100
pre-commit install -f --install-hooks
pre-commit run --all-files

[testenv:venv]
basepython = /usr/bin/python3.5
envdir = venv
commands =

[flake8]
max-line-length = 119

[pep8]
ignore = E265,E309,E501

0 comments on commit 23aa66b

Please sign in to comment.