Skip to content

Commit 979c89b

Browse files
committed
Add y/python-packaging scaffolding.
1 parent 3e64078 commit 979c89b

15 files changed

+176
-0
lines changed

.activate.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
venv/bin/activate

.coveragerc

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[run]
2+
branch = True
3+
source =
4+
.
5+
omit =
6+
.tox/*
7+
/usr/*
8+
setup.py
9+
10+
[report]
11+
show_missing = True
12+
skip_covered = True
13+
14+
exclude_lines =
15+
# Have to re-enable the standard pragma
16+
\#\s*pragma: no cover
17+
18+
# Don't complain if tests don't hit defensive assertion code:
19+
^\s*raise AssertionError\b
20+
^\s*raise NotImplementedError\b
21+
^\s*return NotImplemented\b
22+
^\s*raise$
23+
24+
# Don't complain if non-runnable code isn't run:
25+
^if __name__ == ['"]__main__['"]:$
26+
27+
[html]
28+
directory = coverage-html
29+
30+
# vim:ft=dosini

.deactivate.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deactivate

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.egg-info
2+
*.py[co]
3+
/.cache
4+
/.coverage
5+
/.tox
6+
/coverage-html
7+
/dist
8+
/venv

.pkg_release.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"package_name": "vim-turing-machine"
3+
}

.pre-commit-config.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
- repo: [email protected]:mirrors/pre-commit/pre-commit-hooks
2+
sha: v0.9.1
3+
hooks:
4+
- id: trailing-whitespace
5+
language_version: python3.6
6+
- id: end-of-file-fixer
7+
language_version: python3.6
8+
exclude: ^\.activate\.sh$
9+
- id: autopep8-wrapper
10+
language_version: python3.6
11+
- id: check-docstring-first
12+
language_version: python3.6
13+
- id: check-executables-have-shebangs
14+
language_version: python3.6
15+
- id: check-merge-conflict
16+
language_version: python3.6
17+
- id: check-yaml
18+
language_version: python3.6
19+
- id: debug-statements
20+
language_version: python3.6
21+
- id: double-quote-string-fixer
22+
language_version: python3.6
23+
- id: name-tests-test
24+
language_version: python3.6
25+
- id: flake8
26+
language_version: python3.6
27+
- id: check-added-large-files
28+
language_version: python3.6
29+
exclude: ^\.activate\.sh$
30+
- id: check-byte-order-marker
31+
language_version: python3.6
32+
- id: fix-encoding-pragma
33+
language_version: python3.6
34+
- repo: [email protected]:mirrors/asottile/reorder_python_imports
35+
sha: v0.3.5
36+
hooks:
37+
- id: reorder-python-imports
38+
language_version: python3.6
39+
args: [
40+
'--add-import', 'from __future__ import absolute_import',
41+
'--add-import', 'from __future__ import unicode_literals',
42+
]
43+
- repo: [email protected]:mirrors/asottile/pyupgrade
44+
sha: v1.1.2-1
45+
hooks:
46+
- id: pyupgrade
47+
language_version: python3.6

Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.PHONY: minimal
2+
minimal: venv
3+
4+
.PHONY: venv
5+
venv:
6+
tox -e venv
7+
8+
.PHONY: test
9+
test:
10+
tox
11+
12+
.PHONY: clean
13+
clean:
14+
find -name '*.pyc' -delete
15+
find -name '__pycache__' -delete
16+
rm -rf .tox
17+
rm -rf venv

requirements-dev.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage
2+
pkg-release
3+
pre-commit>=0.15
4+
pytest

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[wheel]
2+
universal = True

setup.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import absolute_import
3+
from __future__ import unicode_literals
4+
5+
from setuptools import find_packages
6+
from setuptools import setup
7+
8+
9+
setup(
10+
name='vim-turing-machine',
11+
version='1.0.0',
12+
classifiers=[
13+
'Programming Language :: Python :: 2',
14+
'Programming Language :: Python :: 2.7',
15+
'Programming Language :: Python :: 3',
16+
'Programming Language :: Python :: 3.6',
17+
],
18+
install_requires=[],
19+
packages=find_packages(exclude=('tests*', 'testing*')),
20+
)

tests/__init__.py

Whitespace-only changes.

tests/example_test.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import absolute_import
3+
from __future__ import unicode_literals
4+
5+
from vim_turing_machine import example
6+
7+
8+
def test_hello():
9+
assert example.hello() == 'world'

tox.ini

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[tox]
2+
envlist = py27,py36
3+
tox_pip_extensions_ext_pip_custom_platform = true
4+
tox_pip_extensions_ext_venv_update = true
5+
indexserver =
6+
default = https://pypi.yelpcorp.com/simple
7+
8+
[testenv]
9+
deps = -rrequirements-dev.txt
10+
passenv = HOME SSH_AUTH_SOCK USER
11+
commands =
12+
coverage erase
13+
coverage run -m pytest {posargs:tests}
14+
coverage report --fail-under 100
15+
pre-commit install -f --install-hooks
16+
pre-commit run --all-files
17+
18+
[testenv:venv]
19+
basepython = /usr/bin/python3.6
20+
envdir = venv
21+
commands =
22+
23+
[flake8]
24+
max-line-length = 119
25+
26+
[pep8]
27+
ignore = E265,E309,E501

vim_turing_machine/__init__.py

Whitespace-only changes.

vim_turing_machine/example.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import absolute_import
3+
from __future__ import unicode_literals
4+
5+
6+
def hello():
7+
return 'world'

0 commit comments

Comments
 (0)