From d8c44711d0deec6e446be2527d6f6145bd4183bb Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 8 Sep 2015 19:11:55 +0200 Subject: [PATCH] Set up coveralls.io hook --- .gitignore | 1 + .travis.yml | 12 +++++++++--- setup.py | 8 ++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 331398c60..649d01a2d 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ mapnik/paths.py .mason/ mason_packages/ mapnik/plugins +.coverage diff --git a/.travis.yml b/.travis.yml index 9e32a797f..af1ce9d85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,16 +42,22 @@ before_install: - PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user nose - PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user wheel - PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user twine + # prevent from compiling libyaml (which fails with clang) when installing PyYAML as python-coveralls dependency + - PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user --global-option="--without-libyaml" PyYAML + - PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user --no-compile python-coveralls - python --version install: - python setup.py install --prefix $(pwd)/mason_packages/.link -before_script: - - python test/run_tests.py -q - script: - python test/visual.py -q + - python setup.py nosetests --with-coverage --cover-package=mapnik + +after_script: + - coveralls + +after_success: - if [[ ${COMMIT_MESSAGE} =~ "[publish]" ]]; then python setup.py bdist_wheel; if [[ $(uname -s) == 'Linux' ]]; then diff --git a/setup.py b/setup.py index 8832a4871..3e707dcd5 100755 --- a/setup.py +++ b/setup.py @@ -113,8 +113,12 @@ def run(self): linkflags = check_output([mapnik_config, '--libs']).split(' ') lib_path = linkflags[0][2:] linkflags.extend(check_output([mapnik_config, '--ldflags']).split(' ')) -except: - raise Exception("Failed to find proper linking flags from mapnik config") +except OSError: + msg = "Missing mapnik-config binary, expected at %s" % mapnik_config + raise Exception(msg) +except Exception as e: + msg = "Failed to find proper linking flags from mapnik config: %s" % str(e) + raise Exception(msg) # Dynamically make the mapnik/paths.py file if it doesn't exist. if os.path.isfile('mapnik/paths.py'):