More pre-commit, more 3.7, more linting, more stages

This commit is contained in:
Hynek Schlawack 2018-11-24 13:17:26 +01:00
parent 8379adfacb
commit a7db21a273
5 changed files with 47 additions and 43 deletions

View File

@ -3,19 +3,29 @@ repos:
rev: 18.9b0
hooks:
- id: black
language_version: python3.6
language_version: python3.7
# override until resolved: https://github.com/ambv/black/issues/402
files: \.pyi?$
types: []
- repo: https://github.com/asottile/seed-isort-config
rev: v1.2.0
rev: v1.5.0
hooks:
- id: seed-isort-config
language_version: python3.6
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
hooks:
- id: isort
language_version: python3.6
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
hooks:
- id: isort
language_version: python3.7
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: flake8
language_version: python3.7

View File

@ -1,4 +1,4 @@
dist: trusty
dist: xenial
group: travis_latest
sudo: false
cache:
@ -12,7 +12,18 @@ matrix:
fast_finish: true
include:
# lint
- python: "3.7"
stage: lint
env: TOXENV=lint
- python: "3.7"
env: TOXENV=manifest
- python: "3.7"
env: TOXENV=typing
# test
- python: "2.7"
stage: test
env: TOXENV=py27
- python: "3.4"
env: TOXENV=py34
@ -22,31 +33,27 @@ matrix:
env: TOXENV=py36
- python: "pypy"
env: TOXENV=pypy
dist: trusty
- python: "pypy3"
env: TOXENV=pypy3
dist: trusty
- python: "3.7"
env: TOXENV=py37
dist: xenial
# Prevent breakage by a new releases
# Prevent breakage by new releases
- python: "3.6-dev"
env: TOXENV=py36
- python: "3.7-dev"
env: TOXENV=py37
# Meta
- python: "3.6"
env: TOXENV=lint
- python: "3.6"
env: TOXENV=manifest
- python: "3.6"
# Docs
- python: "3.7"
stage: docs
env: TOXENV=docs
- python: "3.6"
- python: "3.7"
env: TOXENV=readme
- python: "3.6"
- python: "3.7"
env: TOXENV=changelog
- python: "3.6"
env: TOXENV=typing
allow_failures:
- python: "3.6-dev"

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -26,4 +26,4 @@ multi_line_output=3
not_skip=__init__.py
known_first_party=attr
known_third_party=UserDict,attr,hypothesis,pympler,pytest,setuptools,six,zope
known_third_party=hypothesis,pytest,setuptools,six,zope

31
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
envlist = pre-commit,typing,lint,py27,py34,py35,py36,py37,pypy,pypy3,manifest,docs,readme,changelog,coverage-report
envlist = typing,lint,py27,py34,py35,py36,py37,pypy,pypy3,manifest,docs,readme,changelog,coverage-report
[testenv]
@ -27,37 +27,24 @@ commands = coverage run --parallel -m pytest {posargs}
[testenv:coverage-report]
basepython = python3.6
deps = coverage
basepython = python3.7
skip_install = true
deps = coverage
commands =
coverage combine
coverage report
[testenv:lint]
basepython = python3.7
skip_install = true
basepython = python3.6
extras = tests
deps =
flake8
flake8-isort
black
commands =
flake8 src tests setup.py conftest.py docs/conf.py
black --check setup.py conftest.py src tests docs/conf.py
[testenv:pre-commit]
skip_install = true
basepython = python3.6
deps = pre-commit
passenv = HOMEPATH # needed on Windows
commands = pre-commit run --all-files --verbose
[testenv:docs]
basepython = python3.6
basepython = python3.7
setenv =
PYTHONHASHSEED = 0
extras = docs
@ -68,26 +55,26 @@ commands =
[testenv:manifest]
basepython = python3.6
basepython = python3.7
deps = check-manifest
skip_install = true
commands = check-manifest
[testenv:readme]
basepython = python3.6
basepython = python3.7
deps = readme_renderer
skip_install = true
commands = python setup.py check -r -s
[testenv:changelog]
basepython = python3.6
basepython = python3.7
deps = towncrier
skip_install = true
commands = towncrier --draft
[testenv:typing]
basepython = python3.6
basepython = python3.7
deps = mypy
commands = mypy tests/typing_example.py