forked from networkx/networkx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
63 lines (54 loc) · 2.46 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "pypy"
virtualenv:
system_site_packages: true
before_install:
# Current TravisCI VM is Ubuntu 12.04 which has Python 2.7 and 3.2.
# So apt-get will only apply to those virtualenvs.
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then sudo apt-get install -qq python-numpy python-scipy python-matplotlib python-pydot python-gdal; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]]; then sudo apt-get install -qq python3-numpy python3-scipy; fi
# Additionally, the TravisCI VM has numpy preinstalled on 2.6, 2.7 and 3.2.
# So for 3.3 and pypy, numpy is not preinstalled and must be pip-installed.
# Matplotlib, pydot, and gdal are not available for 3.2 via apt-get.
# And they are also not available for 2.6, 3.3, and pypy except via pip.
# We could install via pip, but...
# skipping numpy (for 3.3 and pypy) since it takes too long.
# skipping scipy (for 2.6, 3.3, and pypy) since it takes too long.
# skipping matplotlib (for 2.6, 3.3, and pypy) since it takes too long.
# skipping pydot (for all) since it is not 3.x compatible.
# skipping gdal (for all) since it has errors while installing from pip.
- pip install pyyaml --use-mirrors
- pip install pyparsing --use-mirrors
- pip install coveralls --use-mirrors
# In general, 2.6, 3.2, 3.3, and pypy will have lower coverage levels
# due to missing dependencies. The coverage level reported by coveralls
# is the average coverage level over all builds.
script:
# Install networkx
- printenv PWD
- pip install .
- export NX_INSTALL=`pip show networkx | grep Location | awk '{print $2"/networkx"}'`
### nose 1.3.0 does not tell coverage to only cover the requested
### package (except during the report). So to restrict coverage, we must
### inform coverage through the .coveragerc file.
- cp .coveragerc $NX_INSTALL
- cp setup.cfg $NX_INSTALL
# Move to new directory so that networkx is not imported from repository.
# Export current directory for logs.
- cd $NX_INSTALL
- printenv PWD
# Run nosetests.
- nosetests --verbosity=2 --with-coverage --cover-package=networkx
after_success:
# We must run coveralls from the git repo.
# But we ran tests from the installed directory.
# The .coverage file looks like it contains absolute paths,
# but coveralls does not seem to care.
- cp .coverage $TRAVIS_BUILD_DIR
- cd $TRAVIS_BUILD_DIR
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls; fi