forked from mikedh/trimesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
134 lines (116 loc) · 4.41 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
133
134
# we are using miniconda python
language: generic
sudo: required
dist: trusty
matrix:
include:
- env: PYTHON_VERSION=2.7
- env: PYTHON_VERSION=3.4
- env: PYTHON_VERSION=3.5
- env: PYTHON_VERSION=3.6
- env: PYTHON_VERSION=3.7
before_deploy:
- pip install -q -r docs/requirements.txt
- python docs/build.py -v
# extract the current trimesh version from the version file
- export TM_VERSION=`python -c "exec(open('trimesh/version.py','r').read()); print(__version__)"`
# tag the release and if it's already tagged chill
- git tag $TM_VERSION || true
deploy:
- provider: pypi
user: mikedh
on:
condition: $PYTHON_VERSION = '3.6'
branch: master
password: $TWINE_PASSWORD
- provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: false
target-branch: gh-pages
local-dir: docs/html
on:
condition: $PYTHON_VERSION = '3.6'
branch: master
- provider: releases
api_key: $GITHUB_TOKEN
skip_cleanup: false
# only release the README github will create source
# tarballs which are what people would want anyway
file: "README.md"
on:
condition: $PYTHON_VERSION = '3.6'
branch: master
before_install:
- sudo apt-get -qq update
- sudo apt-get -qq -y install openscad blender meshlab xvfb pandoc libassimp-dev libspatialindex-dev libgeos-dev
- sudo wget https://github.com/mikedh/v-hacd-1/raw/master/bin/linux/testVHACD --quiet
-P /usr/bin
- sudo chmod +x /usr/bin/testVHACD
install:
- if [[ "$PYTHON_VERSION" == "2.7" ]]; then wget --quiet https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
-O miniconda.sh; else wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
-O miniconda.sh; fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels conda-forge
- conda update -q conda
- conda info -a
- conda create -q -n test-environment python=$PYTHON_VERSION
- source activate test-environment
# make sure we parked our car in the right spot
- python -c "import os,sys;assert '{}.{}'.format(*sys.version_info[:2])==os.environ['PYTHON_VERSION']"
# only install the basic version of the library to make sure
# trimesh imports and functions with only the minimal install
- pip install .
script:
- pip install pytest
# try simple tests that should succeed with only numpy
- python -c "import trimesh"
# grep will print all lines that don't start with a #
# i.e. filter out comments then print out a list of basic tests to run
- cd tests; pytest -p no:warnings `grep -v '^#' basic.list`; cd ..
# install more testing stuff
- pip install pytest-cov pyassimp==4.1.3 jsonschema
# coveralls started failing to install on Python 3.4 so make it optional
- pip install coveralls || true
# install style checkers
- pip install -U autopep8 flake8
# style checks
- flake8 trimesh/
- flake8 example/
- flake8 tests/
# will error on non-pep8 formatting
- autopep8 --recursive --aggressive --diff --exit-code trimesh/
- autopep8 --recursive --aggressive --diff --exit-code examples/
- autopep8 --recursive --aggressive --diff --exit-code tests/
# pyembree, scikit-image, python-fcl not available everywhere
- if [[ "$PYTHON_VERSION" == "3.6" ]]; then conda install pyembree scikit-image; fi;
- if [[ "$PYTHON_VERSION" == "3.6" ]]; then pip install python-fcl; fi;
# lxml stopped supporting EOL Python
- if [[ "$PYTHON_VERSION" == "3.4" ]]; then pip install lxml==4.3.5; fi;
# install most deps here
- pip install -q .[easy]
# xxhash only has linux wheels and is a soft dependancy
- pip install -q xxhash || true
# triangle is compiled, sometimes fails
# on Python 3.7, and is a soft dependency
- pip install -q triangle || true
# run main tests
# -W default means that warnings only prints the
# first instance of a warning rather than all of them
- pytest -W default --cov=trimesh tests/
# make sure examples still work by running them all
- cd examples
- set -xe; for f in *py*; do python ../tests/notebooks.py ci exec "$f"; done
- cd ..
# downgrade networkx from 2.x to 1.x to make sure our
# graph operations work on both versions of their API
- pip install -q -Iv networkx==1.11
# fail if it didn't install old networkx for some reason
- python -c "import networkx; assert networkx.__version__ == '1.11'"
# will print tons of depreciation warnings we don't care about
- pytest -p no:warnings tests/test_graph.py tests/test_scene.py
after_success:
- coveralls || true