Skip to content

Commit d8c4471

Browse files
committed
Set up coveralls.io hook
1 parent 39d3cdf commit d8c4471

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ mapnik/paths.py
1818
.mason/
1919
mason_packages/
2020
mapnik/plugins
21+
.coverage

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,22 @@ before_install:
4242
- PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user nose
4343
- PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user wheel
4444
- PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user twine
45+
# prevent from compiling libyaml (which fails with clang) when installing PyYAML as python-coveralls dependency
46+
- PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user --global-option="--without-libyaml" PyYAML
47+
- PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user --no-compile python-coveralls
4548
- python --version
4649

4750
install:
4851
- python setup.py install --prefix $(pwd)/mason_packages/.link
4952

50-
before_script:
51-
- python test/run_tests.py -q
52-
5353
script:
5454
- python test/visual.py -q
55+
- python setup.py nosetests --with-coverage --cover-package=mapnik
56+
57+
after_script:
58+
- coveralls
59+
60+
after_success:
5561
- if [[ ${COMMIT_MESSAGE} =~ "[publish]" ]]; then
5662
python setup.py bdist_wheel;
5763
if [[ $(uname -s) == 'Linux' ]]; then

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,12 @@ def run(self):
113113
linkflags = check_output([mapnik_config, '--libs']).split(' ')
114114
lib_path = linkflags[0][2:]
115115
linkflags.extend(check_output([mapnik_config, '--ldflags']).split(' '))
116-
except:
117-
raise Exception("Failed to find proper linking flags from mapnik config")
116+
except OSError:
117+
msg = "Missing mapnik-config binary, expected at %s" % mapnik_config
118+
raise Exception(msg)
119+
except Exception as e:
120+
msg = "Failed to find proper linking flags from mapnik config: %s" % str(e)
121+
raise Exception(msg)
118122

119123
# Dynamically make the mapnik/paths.py file if it doesn't exist.
120124
if os.path.isfile('mapnik/paths.py'):

0 commit comments

Comments
 (0)