Convert to use poetry & pyproject.toml for dep & build management (#54)

* Convert to use poetry and pyproject.toml, update README

* add some resources for contributors

* minor adjustments

* ci: separate tests from linting, run using poetry

* add pytest-mock to dev requirements

* combine running tests and reporting to codecov

* generate both xml and html coverage reports

* add codecov to dev dependencies
This commit is contained in:
Teemu R
2020-05-12 12:11:47 +02:00
committed by GitHub
parent c6d76836d7
commit ed57563e8b
19 changed files with 296 additions and 312 deletions

72
tox.ini
View File

@@ -1,16 +1,35 @@
[tox]
envlist=py37,py38,flake8,linting,typing
envlist=py37,py38,flake8,lint,coverage
skip_missing_interpreters = True
isolated_build = True
[tox:travis]
3.7 = py37
3.8 = py38
[testenv]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps = -r{toxinidir}/requirements_test.txt
commands=
pytest --cov --cov-config=tox.ini kasa
whitelist_externals =
poetry
coverage
commands =
poetry install -v
poetry run pytest --cov kasa/tests/
[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase
[testenv:py37]
commands = coverage run -m pytest {posargs}
[testenv:py38]
commands = coverage run -m pytest {posargs}
[testenv:coverage]
basepython = python3.8
skip_install = true
deps = coverage[toml]
commands =
coverage report
coverage html
[testenv:flake8]
deps=
@@ -18,44 +37,7 @@ deps=
flake8-docstrings
commands=flake8 kasa
[testenv:typing]
skip_install=true
deps=mypy
commands=mypy --ignore-missing-imports kasa
[flake8]
exclude = .git,.tox,__pycache__,kasa/tests/newfakes.py,kasa/tests/test_fixtures.py
max-line-length = 88
per-file-ignores =
kasa/tests/*.py:D100,D101,D102,D103,D104
setup.py:D100
ignore = D105, D107, E203, E501, W503
#ignore = E203, E266, E501, W503, F403, F401
#max-complexity = 18
#select = B,C,E,F,W,T4,B9
[testenv:lint]
deps = pre-commit
skip_install = true
commands = pre-commit run --all-files
[coverage:run]
source = kasa
branch = True
omit =
kasa/tests/*
[coverage:report]
exclude_lines =
# ignore abstract methods
raise NotImplementedError
def __repr__
[isort]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
known_first_party=kasa
known_third_party=click,pytest,setuptools,voluptuous