Skip to content

Commit

Permalink
Merge pull request #10 from dangle/destruct
Browse files Browse the repository at this point in the history
Refactor the project into multiple modules.
  • Loading branch information
dangle committed Nov 24, 2017
2 parents 6e7d430 + e5c4ab0 commit a52eb2d
Show file tree
Hide file tree
Showing 12 changed files with 1,138 additions and 1,023 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,10 @@ ENV/
.sublimelinterrc
*.sublime-project
*.sublime-workspace

# VS Code project settings
*.code-workspace
.vscode

# mypy
.mypy_cache
10 changes: 10 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[MASTER]
disable=invalid-metaclass,unsupported-membership-test,no-value-for-parameter,protected-access,function-redefined,too-few-public-methods,invalid-sequence-index,bad-continuation,import-error,invalid-name,no-member,locally-disabled,locally-enabled,redefined-outer-name,redefined-variable-type
reports=no
known-standard-library=typing

[SIMILARITIES]
min-similarity-lines=10
ignore-comments=yes
ignore-docstrings=yes
ignore-imports=yes
5 changes: 0 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,3 @@ addopts = -vvra

[mypy]
ignore_missing_imports=True

[pylint]
disable=no-name-in-module,invalid-metaclass,unsupported-membership-test,no-value-for-parameter,protected-access,function-redefined,too-few-public-methods,invalid-sequence-index,bad-continuation,import-error,invalid-name,no-member,locally-disabled,locally-enabled,redefined-outer-name,redefined-variable-type
reports=no
known-standard-library=typing
6 changes: 4 additions & 2 deletions setup.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
'PEP 483', 'PEP 484', 'PEP 526'],
license='MIT',
packages=find_packages(exclude=['tests', 'docs']),
install_requires=['typingplus >= 2.1, < 3'],
install_requires=[
'pathlib2',
'typingplus >= 2.1.1, < 3'
],
setup_requires=[
'pytest-runner',
'setuptools_scm',
Expand All @@ -34,7 +37,6 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Expand Down
5 changes: 2 additions & 3 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from __future__ import unicode_literals

import os.path
import types
import uuid

import pytest
Expand Down Expand Up @@ -34,7 +33,7 @@ def test_bounded_type():
assert BoundedStr('abc') == 'abc'
with pytest.raises(ValueError):
BoundedStr('abcdef')
assert str(BoundedInt) == 'typet.Bounded[int, 10:20]'
assert str(BoundedInt) == 'typet.validation.Bounded[int, 10:20]'
assert typet.Bounded[Any, 10:20](15) == 15
assert typet.Bounded['int', 20](15) == 15
assert typet.Bounded['int', 10:](15) == 15
Expand All @@ -59,7 +58,7 @@ def test_length_type():
assert LengthBoundedList([1]) == [1]
with pytest.raises(ValueError):
LengthBoundedList([1, 2])
assert str(LengthBoundedStr) == 'typet.Length[str, 1:5]'
assert str(LengthBoundedStr) == 'typet.validation.Length[str, 1:5]'
assert typet.Length[Any, 1:5]('abc') == 'abc'
assert typet.Length['str', 20]('abc') == 'abc'

Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
[tox]
skipsdist = True
envlist = py{27,33,34,35,36}
envlist = py{27,34,35,36}

[testenv]
setenv =
PYTHONDONTWRITEBYTECODE=1
usedevelop = True
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
pytest >= 3.2
pytest >= 3.2, < 4
pytest-cov
coveralls
pep257
flake8
pylint >= 1.7
py{34,35,36}: mypy >= 0.501
commands =
py{27,33,34,35}: py.test --cov=typet --basetemp={envtmpdir} --ignore=tests/py36 {posargs}
py{27,34,35}: py.test --cov=typet --basetemp={envtmpdir} --ignore=tests/py36 {posargs}
py36: py.test --cov=typet --basetemp={envtmpdir} {posargs}
- coveralls
pep257 setup.py typet tests
flake8 setup.py typet
pylint --rcfile=setup.cfg setup.py typet
pylint setup.py typet
py{34,35,36}: - mypy --config=setup.cfg setup.py typet
Loading

0 comments on commit a52eb2d

Please sign in to comment.