diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..40799b53 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,4 @@ +[flake8] +# https://github.com/ambv/black#slices +# https://github.com/ambv/black#line-breaks--binary-operators +ignore = E203, W503 diff --git a/setup.py b/setup.py index 5e5eb2de..37164336 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def open_local(paths, mode='r', encoding='utf8'): with open_local(['sanic', '__init__.py'], encoding='latin1') as fp: try: - version = re.findall(r"^__version__ = '([^']+)'\r?$", + version = re.findall(r"^__version__ = \"([^']+)\"\r?$", fp.read(), re.M)[0] except IndexError: raise RuntimeError('Unable to determine version.') diff --git a/tox.ini b/tox.ini index cb8e4fc9..ab32aa20 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35, py36, py37, {py35,py36,py37}-no-ext, flake8, check +envlist = py35, py36, py37, {py35,py36,py37}-no-ext, lint, check [testenv] usedevelop = True @@ -21,12 +21,14 @@ commands = - coverage combine --append coverage report -m -[testenv:flake8] +[testenv:lint] deps = flake8 + black commands = flake8 sanic + black --check --verbose sanic [testenv:check] deps =