forked from tommyod/KDEpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
72 lines (61 loc) · 1.98 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
language: python
notifications:
email: false
# The matrix expands to 3 builds: OSX and linux to build wheels
# and py36 and py37 for general testing
# For more information about building wheels, see:
# https://pythonwheels.com/
# https://github.com/joerick/cibuildwheel
# https://malramsay.com/post/perils_of_packaging/
matrix:
include:
- os: linux
sudo: required
services: docker
python: '3.6'
- os: linux
dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069)
sudo: required
services: docker
python: '3.7'
- os: osx
language: generic
# The first 3 global variables are for the cibuildwheel python package
# The remaining 2 are set to assure Python 3 is used on OS X (mac)
env:
global:
- CIBW_SKIP="cp27-* cp33-* cp34-*"
- CIBW_TEST_REQUIRES=pytest
- CIBW_TEST_COMMAND="python3 -m pytest {project} --doctest-modules"
- PIP=pip3
- PYTHON=python3
# If OS X - install Pyton 3 as python3.
# Print the python version, install general requirements and linting
before_install:
- if [ "${TRAVIS_OS_NAME:-}" == "osx" ]; then
brew update;
fi
- if [ "${TRAVIS_OS_NAME:-}" -ne "osx" ]; then
sudo apt install libpython3.6-dev;
fi
- $PYTHON --version
- $PIP install -r requirements.txt
- $PIP install pep8>=1.7.1
- $PIP install flake8>=3.5.0
# Install the package, create source distribution (worse alternative to wheels)
# Run the tests.
install:
- $PYTHON setup.py develop sdist
- $PYTHON -m pytest KDEpy --doctest-modules --capture=sys
# Linting
before_script:
- $PYTHON -m flake8 --show-source --ignore=F811,W293,W391,W292,W291,W504,W503 --max-line-length=88 --exclude="*examples.py,testing.py,*kde.py" KDEpy
# If a tag was used, build wheels and deply to pypi
script:
- echo "$TRAVIS_TAG"
- if [ -n "$TRAVIS_TAG" ]; then
$PIP install cibuildwheel;
$PYTHON -m cibuildwheel --output-dir wheelhouse;
$PIP install twine;
$PYTHON -m twine upload dist/* -u tommyod -p $TWINE_PASSWORD --skip-existing;
fi