Skip to content

Commit 07a5a8f

Browse files
committed
add travis support
1 parent c3f4630 commit 07a5a8f

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.travis.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
language: python
2+
dist: trusty
3+
sudo: false
4+
cache:
5+
directories:
6+
- $HOME/Library/Caches/Homebrew
7+
env:
8+
global:
9+
- MUPDF='https://mupdf.com/downloads/mupdf-1.12.0-source.tar.gz'
10+
- COPYFILE_DISABLE=1 # for macos tar errors
11+
- TWINE_USERNAME=rk700
12+
13+
matrix:
14+
include:
15+
- os: linux
16+
sudo: required
17+
python: "3.6"
18+
services:
19+
- docker
20+
env: PIP=pip
21+
before_script:
22+
- export CIBW_BEFORE_BUILD="yum install -y zlib-devel && cd mupdf && make HAVE_X11=no HAVE_GLFW=no HAVE_GLUT=no prefix=/usr/local install && cd .."
23+
- export CIBW_ENVIRONMENT='CFLAGS="-fPIC -std=gnu99"'
24+
25+
- os: osx
26+
osx_image: xcode8.3
27+
language: generic # osx + "language: python" is broken; use generic
28+
services:
29+
- docker
30+
env: PIP=pip3
31+
before_install:
32+
- brew update -q
33+
- brew outdated python || brew upgrade python # get py3
34+
- sudo mkdir -p /usr/local/man && sudo chmod a+rw /usr/local/man # make pip install error go away
35+
before_script:
36+
- export CIBW_BEFORE_BUILD="cd mupdf && make HAVE_X11=no HAVE_GLFW=no HAVE_GLUT=no prefix=/usr/local install && cd .."
37+
- export CIBW_ENVIRONMENT='CFLAGS=-fPIC'
38+
39+
install:
40+
- $PIP install cibuildwheel==0.7.0 twine
41+
- mkdir mupdf && wget -q $MUPDF -O - | tar zx -C mupdf --strip-components=1
42+
43+
script:
44+
- export CIBW_ENVIRONMENT='CFLAGS="-fPIC -std=gnu99"'
45+
- export CIBW_SKIP="cp33-* *i686" # Skip Python 3.3 and i686 (<1% of users now)
46+
- export CIBW_TEST_COMMAND="python -c 'import fitz'"
47+
- cibuildwheel --output-dir wheelhouse
48+
- |
49+
if [[ "$TRAVIS_TAG" != "" ]]; then
50+
python3 -m twine upload wheelhouse/*.whl
51+
fi

0 commit comments

Comments
 (0)