mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 04:00:18 +03:00
Add tox, coverage, flake8 and Travis config.
This commit is contained in:
parent
23989a1c92
commit
f4a5343040
34
.travis.yml
Normal file
34
.travis.yml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
sudo: false
|
||||||
|
language: python
|
||||||
|
|
||||||
|
cache: pip
|
||||||
|
|
||||||
|
# Tox cannot install pythons, so we set 3.5 as default, use 3.4 already
|
||||||
|
# available in container and then include 3.6 in matrix.
|
||||||
|
python:
|
||||||
|
- 3.5
|
||||||
|
|
||||||
|
env:
|
||||||
|
- TOXENV=py34
|
||||||
|
- TOXENV=py35
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- python: 3.6
|
||||||
|
env: TOXENV=py36
|
||||||
|
- python: 3.4 # i.e. skip installing 3.5
|
||||||
|
env: TOXENV=lint
|
||||||
|
- python: 3.4
|
||||||
|
env: TOXENV=coverage
|
||||||
|
|
||||||
|
install:
|
||||||
|
- pip install tox
|
||||||
|
|
||||||
|
script:
|
||||||
|
- tox
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- if [[ $TOXENV =~ coverage ]]; then
|
||||||
|
pip install --quiet python-coveralls;
|
||||||
|
coveralls --ignore-errors;
|
||||||
|
fi
|
19
setup.cfg
Normal file
19
setup.cfg
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
[flake8]
|
||||||
|
exclude = .eggs,.tox,.git
|
||||||
|
max-line-length = 100
|
||||||
|
max-complexity = 14
|
||||||
|
|
||||||
|
[coverage:run]
|
||||||
|
source = telethon
|
||||||
|
#branch = True
|
||||||
|
parallel = True
|
||||||
|
|
||||||
|
[coverage:report]
|
||||||
|
ignore_errors = True
|
||||||
|
skip_covered = True
|
||||||
|
show_missing = True
|
||||||
|
|
||||||
|
# Regex expressions for lines excluded from report
|
||||||
|
exclude_lines =
|
||||||
|
pragma: no cover
|
||||||
|
if __name__ == .__main__.:
|
26
tox.ini
Normal file
26
tox.ini
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
[tox]
|
||||||
|
envlist = py34,py35,py36
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
recreate = True
|
||||||
|
commands = coverage run setup.py test
|
||||||
|
install_command =
|
||||||
|
pip install {opts} {packages}
|
||||||
|
deps = coverage
|
||||||
|
|
||||||
|
[testenv:coverage]
|
||||||
|
basepython = python3.4
|
||||||
|
skip_install = true
|
||||||
|
commands =
|
||||||
|
coverage combine
|
||||||
|
coverage report
|
||||||
|
deps =
|
||||||
|
coverage
|
||||||
|
|
||||||
|
[testenv:lint]
|
||||||
|
basepython = python3.4
|
||||||
|
skip_install = true
|
||||||
|
commands =
|
||||||
|
flake8
|
||||||
|
deps =
|
||||||
|
flake8
|
Loading…
Reference in New Issue
Block a user