From bd418968e5f2a616d1f86e33e1e8ec06f80f55ea Mon Sep 17 00:00:00 2001 From: Lukas Puehringer Date: Tue, 25 Jun 2019 15:30:51 +0200 Subject: [PATCH] Update travis to xenial and misc updates - Add a build matrix to run each tox env in a corresponding travis env as per travis/tox best practices. https://docs.travis-ci.com/user/languages/python/#using-tox-as-the-build-script - Add Python 3.5 tests - Remove only build on certain branch restrictions - Use "install" instead of "before_script" to install dependencies. Explicitly listing "install" prevents Travis from automatically running `pip install -r requirements.txt`, which is not necessary because most of those requirements are installed again in each tox environment. - Move pylint and bandit calls to tox (pylint requires dependencies) to be installed. Signed-off-by: Lukas Puehringer --- .travis.yml | 30 +++++++++++++----------------- ci-requirements.txt | 2 +- tox.ini | 2 ++ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6b82b43..75f7ccf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,25 @@ +dist: xenial language: python -dist: trusty -sudo: false cache: pip -python: 3.6 -env: - - TOXENV=py27 - - TOXENV=py34 - - TOXENV=py36 +matrix: + include: + - python: "2.7" + env: TOXENV=py27 + - python: "3.4" + env: TOXENV=py34 + - python: "3.5" + env: TOXENV=py35 + - python: "3.6" + env: TOXENV=py36 -before_script: - - pip install pylint bandit tox coveralls +install: + - pip install tox coveralls script: - - pylint tuf - - bandit -r tuf - tox after_success: - cd tests - coveralls - cd - - -branches: - only: - - develop - - pylint - - bandit diff --git a/ci-requirements.txt b/ci-requirements.txt index f737ed8d..ac26653c 100644 --- a/ci-requirements.txt +++ b/ci-requirements.txt @@ -2,6 +2,6 @@ securesystemslib[crypto,pynacl] six iso8601 coverage -coveralls pylint +bandit requests diff --git a/tox.ini b/tox.ini index ddee6288..f8609975 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,8 @@ envlist = py27, py34, py35, py36 changedir = tests commands = + pylint {toxinidir}/tuf + bandit -r {toxinidir}/tuf coverage run --source tuf aggregate_tests.py coverage report -m --fail-under 97