From 77c63f989391a21e2d6e0272a5e4f5282f2f74c6 Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Sun, 13 Dec 2015 23:22:57 +0000 Subject: [PATCH 1/2] Run flake8 in all builds on Travis. --- .travis.yml | 12 ------------ flake8-run.sh | 12 +++++------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad425cc9..24fa867c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,18 +17,6 @@ env: - USE_OPTIONAL=true - USE_OPTIONAL=false -matrix: - exclude: - - python: "2.7" - env: USE_OPTIONAL=false - - python: "3.4" - env: USE_OPTIONAL=false - include: - - python: "2.7" - env: USE_OPTIONAL=false FLAKE=true - - python: "3.4" - env: USE_OPTIONAL=false FLAKE=true - before_install: - git submodule update --init --recursive diff --git a/flake8-run.sh b/flake8-run.sh index d1a587d3..685ec6ab 100755 --- a/flake8-run.sh +++ b/flake8-run.sh @@ -5,10 +5,8 @@ if [[ ! -x $(which flake8) ]]; then exit 1 fi -if [[ $TRAVIS != "true" || $FLAKE == "true" ]]; then - find html5lib/ -name '*.py' -and -not -name 'constants.py' -print0 | xargs -0 flake8 --ignore=E501 - flake1=$? - flake8 --max-line-length=99 --ignore=E126 html5lib/constants.py - flake2=$? - exit $[$flake1 || $flake2] -fi +find html5lib/ -name '*.py' -and -not -name 'constants.py' -print0 | xargs -0 flake8 --ignore=E501 +flake1=$? +flake8 --max-line-length=99 --ignore=E126 html5lib/constants.py +flake2=$? +exit $[$flake1 || $flake2] From 66a3f42444cb1d4d2cfa32f6d1d69243baa6a9fa Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Sun, 13 Dec 2015 23:25:04 +0000 Subject: [PATCH 2/2] Add codecov. --- .coveragerc | 8 ++++++++ .travis.yml | 6 +++++- requirements-install.sh | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..6facf352 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +branch = True +source = html5lib + +[paths] +source = + html5lib + .tox/*/lib/python*/site-packages/html5lib diff --git a/.travis.yml b/.travis.yml index 24fa867c..94bb87e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,12 @@ install: - bash requirements-install.sh script: - - py.test + - if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then py.test; fi + - if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage run -m pytest; fi - bash flake8-run.sh after_script: - python debug-info.py + +after_success: + - if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage combine && codecov; fi diff --git a/requirements-install.sh b/requirements-install.sh index a8964ea0..8cab142d 100755 --- a/requirements-install.sh +++ b/requirements-install.sh @@ -13,3 +13,7 @@ pip install -U -r requirements-test.txt if [[ $USE_OPTIONAL == "true" ]]; then pip install -U -r requirements-optional.txt fi + +if [[ $CI == "true" ]]; then + pip install -U codecov +fi