diff --git a/.travis.yml b/.travis.yml index 25fe0e5fc5..8674d4d038 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,16 @@ language: python -install: "pip install pytest pyyaml" -python: - - "2.7" -script: "py.test tests" + +matrix: + allow_failures: + - env: TOXENV=lint + include: + - python: 2.7 + env: TOXENV=py27 + - python: 2.7 + env: TOXENV=lint + +install: + - pip install tox + +script: + - tox diff --git a/README.md b/README.md index 900b589301..d06e97c455 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Build Status](https://travis-ci.org/YunoHost/yunohost.svg?branch=stretch-unstable)](https://travis-ci.org/YunoHost/yunohost) +[![GitHub license](https://img.shields.io/github/license/YunoHost/yunohost)](https://github.com/YunoHost/yunohost/blob/stretch-unstable/LICENSE) + # YunoHost core This repository is the core of YunoHost code. diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000000..f9200ab9c6 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +addopts = -s -v +norecursedirs = dist doc build .tox .eggs +testpaths = tests/ diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000..db1dde69d0 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +ignore = E501,E128,E731,E722 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000000..ac109609c1 --- /dev/null +++ b/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist = + py27 + lint +skipdist = True + +[testenv] +skip_install=True +deps = + pytest >= 4.6.3, < 5.0 + pyyaml >= 5.1.2, < 6.0 +commands = + pytest {posargs} + +[testenv:lint] +skip_install=True +commands = flake8 src doc data tests +deps = flake8