forked from PmagPy/PmagPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
132 lines (124 loc) · 6.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
language: python
matrix:
include:
- name: "Python 3.7.1 on Xenial Linux"
python: "3.7" # this works for Linux but is ignored on macOS or Windows
dist: xenial # required for Python >= 3.7. BUT doesn't seem to work with conda.
services:
- xvfb
addons:
apt:
packages: # mainly wxPython dependencies
- libwebkitgtk-dev
- libjpeg-dev
- libtiff-dev
- libgtk2.0-dev
- libsdl1.2-dev
- libgstreamer-plugins-base0.10-dev
- freeglut3
- freeglut3-dev
- libnotify-dev
- libproj-dev # Proj.4 is a dependency of cartopy
before_install:
- lsb_release -a # check ubuntu version
- sudo apt-get update -qq # make sure package indexes are up to date
- "export DISPLAY=:99.0" # make the GUI testing work with the host machine display
#- "sh -e /etc/init.d/xvfb start"
install:
- pip3 install cython pillow pytest pep8 pyshp shapely
- pip3 install six requests pyepsg owslib cartopy future numpy==1.16.1 scipy
- pip3 install pandas libtiff
# get latest version of wxPython4:
# - pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython # regular pip install wxPython does not work
# get wxPython-4.0.4:
- pip3 install https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04/wxPython-4.0.4-cp37-cp37m-linux_x86_64.whl
# get wxPython-4.0.6:
#- pip3 install https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04/wxPython-4.0.6-cp37-cp37m-linux_x86_64.whl
- pip3 install appdirs
- pip3 install matplotlib==3.0.3 # 3.1 causes some problems with polemap/vgpmap
- pip3 install scripttest
- pip3 install xlwt
- pip3 install wget
- sudo apt-get update
script :
- pip list
- python -V -V
- python -c "import sys; print(sys.version)"
- python -c "import wx; print(wx.version)"
- python -c "import wx.grid; print(wx.grid)"
- python -m unittest discover -v
# seems that GUI testing isn't yet available for OSX OR I don't know how to make it work
# other tests appear to work correctly
- name: "Python 3.6 (miniconda) on macOS"
os: osx
osx_image: xcode10.2 #
language: shell # 'language: python' is an error on Travis CI macOS
install:
# fully install miniconda
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
# configure conda settings
- conda config --set always_yes yes --set changeps1 no --set show_channel_urls yes
- conda update conda
# create test environment
- ENV_NAME="test-environment"
- conda create -n $ENV_NAME python=3.6
- source activate $ENV_NAME
# install req'd packages with conda
- PACKAGES="$PACKAGES cython pillow pytest pep8 proj4 pyshp shapely six requests pyepsg owslib"
- conda install --quiet $PACKAGES
- conda install --quiet cartopy
- conda install --quiet pandas>=0.24.2 libtiff numpy scipy future requests
- conda install --quiet xlwt # for pandas df.to_excel
- conda install --quiet wxPython
- conda install --quiet appdirs
- conda install --quiet regex
- conda install --quiet matplotlib # 3.1 or higher
- conda install scripttest --channel conda-forge
- pip install wget
#script : pythonw -m unittest discover -v
script :
- python -V -V
# these tests all run! add more
- pythonw -m unittest pmagpy_tests.test_contribution_builder pmagpy_tests.test_env pmagpy_tests.test_imports2 pmagpy_tests.test_imports3 pmagpy_tests.test_ipmag pmagpy_tests.test_make_plots pmagpy_tests.test_map_magic pmagpy_tests.test_pmag pmagpy_tests.test_pmagplotlib pmagpy_tests.test_simple_example pmagpy_tests.test_validations
# tests that don't work: test_programs, test_find_pmag_dir, all GUI tests
# tests with GUI stuff don't work
# seems that GUI testing isn't yet available OR I don't know how to make it work
# also, I need to figure out cartopy
- name: "Python 3.7.3 (choco) on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install: choco install python --version 3.7.4
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
install:
- pip install numpy
- pip install pandas>=0.24.2 libtiff numpy scipy future requests appdirs matplotlib # 3.1 or higher
- pip install cython pillow pytest pep8 six requests
- pip install -U wxPython
- pip install scripttest
- pip install xlwt
- pip install geos
- pip install regex
- pip install wget
## trying two commands to install proj4 (fails on the second command)
#- curl -o C:\temp\osgeo4w-setup-x86-64.exe http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe
#- C:\\temp\\osgeo4w-setup-x86-64.exe -q -k -r -A -s http://download.osgeo.org/osgeo4w/ -a x86_64 -P proj
## trying to install shapely
# - pip3 install -U -f 'https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely/Shapely‑1.6.4.post1‑cp37‑cp37m‑win_amd64.whl' shapely # seems the closest to working, but still fails
#- pip3 install shapely # breaks
#- pip3 install "Shapely‑1.6.4.post1‑cp37‑cp37m‑win_amd64.whl" # fails
## trying to install cartopy
#- pip3 install cartopy # fails because proj4 is not installed
#script: python -m unittest discover -v
script:
- python -V -V
- python -m unittest pmagpy_tests.test_simple_example pmagpy_tests.test_pmag pmagpy_tests.test_ipmag -v
# can't get cartopy, so pmagplotlib (etc.) can't be run
# exits with 0, but doesn't actually finish running :(
#- python -m pmagpy_tests.test_pmag pmagpy_tests.test_contribution_builder -v
# https://stackoverflow.com/questions/29290011/using-travis-ci-with-wxpython-tests
## specific tasks to run after failure
#after_failure:
# - conda activate $ENV_NAME
# - python -c "from __future__ import print_function; import cartopy.tests.mpl; print(cartopy.tests.mpl.failed_images_html())"