diff options
| author | Michael Merickel <michael@merickel.org> | 2018-10-10 09:53:09 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2018-10-15 09:24:04 -0500 |
| commit | 851c368e3c158e264358de10446f5b5de240e534 (patch) | |
| tree | d31d9831ec6ebf6e0143b724f97011c1fff000c5 | |
| parent | 81576ee51564c49d5ff3c1c07f214f22a8438231 (diff) | |
| download | pyramid-851c368e3c158e264358de10446f5b5de240e534.tar.gz pyramid-851c368e3c158e264358de10446f5b5de240e534.tar.bz2 pyramid-851c368e3c158e264358de10446f5b5de240e534.zip | |
configure black and update flake8
| -rw-r--r-- | .flake8 | 18 | ||||
| -rw-r--r-- | .travis.yml | 4 | ||||
| -rw-r--r-- | MANIFEST.in | 3 | ||||
| -rw-r--r-- | pyproject.toml | 31 | ||||
| -rw-r--r-- | setup.cfg | 53 | ||||
| -rw-r--r-- | tox.ini | 18 |
6 files changed, 67 insertions, 60 deletions
diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..f8da47c1a --- /dev/null +++ b/.flake8 @@ -0,0 +1,18 @@ +[flake8] +ignore = + # E203: whitespace before ':' (black fails to be PEP8 compliant) + E203 + # E731: do not assign a lambda expression, use a def + E731 + # W503: line break before binary operator (flake8 is not PEP8 compliant) + W503 +exclude = + src/pyramid/compat.py + src/pyramid/scaffolds/alchemy + src/pyramid/scaffolds/starter + src/pyramid/scaffolds/zodb + tests/fixtures + tests/pkgs + tests/test_config/pkgs + tests/test_config/path +show-source = True diff --git a/.travis.yml b/.travis.yml index dcbd37294..6efbee21b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,11 +16,11 @@ matrix: env: TOXENV=pypy - python: pypy3 env: TOXENV=pypy3 - - python: 3.5 + - python: 3.6 env: TOXENV=py2-cover,py3-cover,coverage - python: 3.5 env: TOXENV=docs - - python: 3.5 + - python: 3.6 env: TOXENV=lint - python: 3.7 env: TOXENV=py37 diff --git a/MANIFEST.in b/MANIFEST.in index 94da9d899..934fc973a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,7 +8,8 @@ include CHANGES.rst HISTORY.rst BFG_HISTORY.rst include CONTRIBUTORS.txt LICENSE.txt COPYRIGHT.txt include contributing.md RELEASING.txt -include .coveragerc tox.ini appveyor.yml .travis.yml rtd.txt +include .coveragerc .flake8 setup.cfg pyproject.toml +include tox.ini appveyor.yml .travis.yml rtd.txt graft .github include HACKING.txt hacking-tox.ini diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..b30e4f465 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["setuptools", "wheel"] + +[tool.black] +line-length = 79 +skip-string-normalization = true +py36 = false +exclude = ''' +/( + \.git + | \.mypy_cache + | \.tox + | \.venv + | \.pytest_cache + | dist + | build + | docs + | src/pyramid/scaffolds/alchemy + | src/pyramid/scaffolds/starter + | src/pyramid/scaffolds/zodb +)/ +''' + + # This next section only exists for people that have their editors +# automatically call isort, black already sorts entries on its own when run. +[tool.isort] +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +combine_as_imports = true +line_length = 79 @@ -16,59 +16,6 @@ universal = 1 [metadata] license_file = LICENSE.txt -[flake8] -ignore = - # E121: continuation line under-indented for hanging indent - E121, - # E123: closing bracket does not match indentation of opening bracket's line - E123, - # E125: continuation line with same indent as next logical line - E125, - # E127: continuation line over-indented for visual indent - E127, - # E128: continuation line under-indented for visual indent - E128, - # E129: visually indented line with same indent as next logical line - E129, - # E201: whitespace after '(' - E201, - # E202: whitespace before ')' - E202, - # E231: missing whitespace after ',', ';', or ':' - E231, - # E261: at least two spaces before inline comment - E261, - # E262: inline comment should start with '# ' - E262, - # E265: block comment should start with '# ' - E265, - # E266: too many leading '#' for block comment - E266, - # E301: expected 1 blank line, found 0 - E301, - # E302: expected 2 blank lines, found 0 - E302, - # E303: too many blank lines (3) - E303, - # E305: expected 2 blank lines after class or function definition, found 1 - E305, - # E306: expected 1 blank line before a nested definition, found 0 - E306, - # E501: line too long (82 > 79 characters) - E501, - # E731: do not assign a lambda expression, use a def - E731, - # W291: trailing whitespace - W291, - # W293: blank line contains whitespace - W293, - # W391: blank line at end of file - W391, - # W503: line break before binary operator - W503 -exclude = pyramid/tests/,pyramid/compat.py,pyramid/resource.py -show-source = True - [check-manifest] ignore = .gitignore @@ -17,7 +17,7 @@ basepython = pypy: pypy pypy3: pypy3 py2: python2.7 - py3: python3.5 + py3: python3.6 commands = nosetests --with-xunit --xunit-file=nosetests-{envname}.xml {posargs:} @@ -63,13 +63,15 @@ deps = virtualenv [testenv:lint] skip_install = true -basepython = python3.5 +basepython = python3.6 commands = - flake8 pyramid/ + flake8 src/pyramid tests setup.py + black --check --diff src/pyramid tests setup.py python setup.py check -r -s -m check-manifest deps = flake8 + black readme_renderer check-manifest @@ -113,7 +115,7 @@ extras = [testenv:coverage] skip_install = true -basepython = python3.5 +basepython = python3.6 commands = coverage erase coverage combine @@ -124,6 +126,14 @@ deps = setenv = COVERAGE_FILE=.coverage +[testenv:black] +skip_install = true +basepython = python3.6 +commands = + black src/pyramid tests setup.py +deps = + black + [testenv:build] skip_install = true basepython = python3.6 |
