From 59974ffab56e4cf438622d9bf3ee1808cc781fac Mon Sep 17 00:00:00 2001 From: baztian Date: Fri, 10 Mar 2017 15:59:28 +0100 Subject: [PATCH] Move coveralls handling from tox to travis to work around Jython urllib issues. --- .travis.yml | 4 ++++ ci/run_coveralls.py | 28 ---------------------------- tox.ini | 4 +--- 3 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 ci/run_coveralls.py diff --git a/.travis.yml b/.travis.yml index e3ed5fa..d88f2b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,10 @@ before_install: - export PATH="$HOME/bin:$PATH" install: + - pip install coveralls - pip install tox-travis script: tox + +after_success: + - coveralls diff --git a/ci/run_coveralls.py b/ci/run_coveralls.py deleted file mode 100644 index df9a0ab..0000000 --- a/ci/run_coveralls.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/env/python - -"""Runs coveralls if in Travis CI build environment. Taken from -http://stackoverflow.com/a/33012308/1960601 -""" - -import json -import os -import pickle -import sys - -from subprocess import call - -def convert_old_coverage_to_new(filename): - with open(filename, "rb") as inp_file: - coverage_results = pickle.load(inp_file) - main_results ={"lines": coverage_results['lines']} - with open(".coverage","w") as out_file: - out_file.write("!coverage.py: This is a private format," - "don't read it directly!") - out_file.write(json.dumps(main_results)) - -if __name__ == '__main__': - if sys.platform.lower().startswith('java'): - convert_old_coverage_to_new(".coverage") - if 'TRAVIS' in os.environ: - rc = call('coveralls') - raise SystemExit(rc) diff --git a/tox.ini b/tox.ini index 0fdfe62..1cf242f 100644 --- a/tox.ini +++ b/tox.ini @@ -23,10 +23,9 @@ deps = py26: unittest2==0.5.1 # urllib3 required by coveralls. See https://github.com/eddyxu/cpp-coveralls/issues/108 py26: urllib3[secure] - jython: coverage==3.7.1 py: JPype1==0.6.2 jip==0.9.10 - coveralls + coverage commands = python --version python ci/jipconf_subst.py {envdir} {toxworkdir}/shared @@ -36,4 +35,3 @@ commands = driver-mock: jip install org.jaydebeapi:mockdriver:1.0-SNAPSHOT coverage run -a --source jaydebeapi test/testsuite.py {env:TESTNAME} driver-hsqldb: coverage run -a --source jaydebeapi test/doctests.py - python ci/run_coveralls.py