From 5ac7ffd5c28fc61546e7cfe1afdada980e02f337 Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Thu, 23 May 2019 13:16:14 -0300 Subject: [PATCH 1/4] Install and use coverage only when needed. --- .travis.yml | 22 +++++++++++++++++----- requirements.txt | 2 -- test | 4 +--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 09887be..a6584ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,15 +6,27 @@ python: - "3.7-dev" install: - "pip install -r requirements.txt" - - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install python-coveralls ; fi + - > + if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]] + then + pip install python-coveralls pytest-cov + fi script: - - "pytest --cov=fades" -after_script: - - "flake8 fades --max-line-length=99 --select=E,W,F,C,N" + - > + if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]] + then + pytest --cov=fades + else + pytest + fi # report coverage to coveralls.io after_success: - - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then coveralls; fi + - > + if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]] + then + coveralls + fi cache: apt: true diff --git a/requirements.txt b/requirements.txt index feaab9b..12158cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,9 +7,7 @@ pyxdg==0.25 rst2html5==1.9.3 setuptools>=5.5 wheel==0.26.0 -coverage==4.0.3 pytest==4.4.2 pytest-xdist==1.28.0 pytest-sugar==0.9.2 -pytest-cov==2.5.1 pytest-mock==1.10.4 diff --git a/test b/test index 71b29bb..c9f758b 100755 --- a/test +++ b/test @@ -10,9 +10,7 @@ else TARGET_TESTS="" fi -FADES='./bin/fades -r requirements.txt' - -$FADES -x pytest --cov=fades $TARGET_TESTS +./bin/fades -r requirements.txt -d pytest-cov -x pytest --cov=fades $TARGET_TESTS # check if we are using exit() in the code. if grep -r -n ' exit(' --include="*.py" .; then echo 'Please use sys.exit() instead of exit(). https://github.com/PyAr/fades/issues/280'; fi From c269e78a51f18ac411f262726a955b1db0e2d0e8 Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Thu, 23 May 2019 13:22:29 -0300 Subject: [PATCH 2/4] Restricted pytest-cov to old version in .travis as otherwise conflicts with python-coveralls in the coverage dependency. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a6584ce..bde23d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ install: - > if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]] then - pip install python-coveralls pytest-cov + pip install python-coveralls "pytest-cov<2.6.0" fi script: - > From cf105c159398ccf5115e677ccad6ba2dbb006bc0 Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Thu, 23 May 2019 13:28:50 -0300 Subject: [PATCH 3/4] Upgraded which Python is stable. --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index bde23d5..ab090db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,18 @@ language: python python: - "3.5" - "3.6" - - "3.7-dev" + - "3.7" + - "3.8-dev" install: - "pip install -r requirements.txt" - > - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]] + if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]] then pip install python-coveralls "pytest-cov<2.6.0" fi script: - > - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]] + if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]] then pytest --cov=fades else @@ -23,7 +24,7 @@ script: # report coverage to coveralls.io after_success: - > - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]] + if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]] then coveralls fi From e49bc97db63f6766f946f6827777b5a4669d0b57 Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Thu, 23 May 2019 13:47:39 -0300 Subject: [PATCH 4/4] Upgraded dist to xenial in travis to support modern pythons. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index ab090db..66dff87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +dist: xenial # required for Python >= 3.7 + language: python python: