-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
184 lines (173 loc) · 5.92 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
language: python
cache: pip
env:
global:
# GITHUB_API_TOKEN
- secure: YNLKYudc4YRn+i89r20lB8oDoigXqiBWHpBi+QVNUCuzbHcp1rtK5/uwvbMEzERPTcRsFcqp0BHOaXf8PzWFVYVVlLCag9eX69HuOopHakW6zvZgWEv5ZVUbzLatJmOJ6BXIP+b6o83lgrO1khG2e8VRPVVwO8D0kadr2zwpuH4=
# APPVEYOR_API_TOKEN
- secure: UaLfn9kWVK+EyYxvjZzoV3m3ODs+iD0F57kCF4Z+YqXdo3oPxd+hIoEpo9VtkXAvhNLbj3kvCyiv+J+lqEwuR6uoAFaiz70LaAsxIX1CuHzNhJRxUglK4TdTdoGXHo2bbiTPZRnPkYwFYip5ehx8q7tPnL+xgu3AiTTLvSr0R6g=
# TWINE_USERNAME
- secure: Od+iImlaOP2qzkGstfj3TTmhqWDdtZ1+CGFPJnHzZ9mj9l3Pg1Aek369f1MsGBXZeJqojiTx1xg/XzW3xH39QzbuynMGEFYOAZDnQMJsT990H1vKyHsoQ86t4n0T7FEIs6B5BzP1oDROdADHcxmRQ1BoSvWumbq/isGewArGO0M=
# TWINE_PASSWORD
- secure: cMN061O5PjB3B8+iSEgyo/qe3QPSDW8GaAupYtHKLnxT2M6JiepuVzZL40y9I1QTnZQMf8VIKH7XExLkgyVvbKZyQCctp9tioBBiAafp6uhAQMLSzj1+03gBzaJQJySPMLX4Snfa/TuhOqym5m4kYQTX/p3qCImzkgxWW1SV+rc=
- TWINE_TEST_REPOSITORY=pypitest
- TWINE_TEST_REPOSITORY_URL=https://test.pypi.org/legacy/
- TWINE_PROD_REPOSITORY=pypi
- TWINE_PROD_REPOSITORY_URL=https://upload.pypi.org/legacy/
stages:
- name: test
- name: deploy
if: type = push AND tag IS present
os:
- linux
dist: jammy
addons:
apt:
packages:
- pandoc
python:
# Each commented python version has a custom include for a different distro
# - "2.7"
# - "pypy"
- "pypy3"
# - "3.3"
# - "3.4"
# - "3.5"
# - "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
before_install:
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
echo "Updating brew packages.";
brew update 1>&2 || travis_terminate 1;
if [[ $TRAVIS_PYTHON_VERSION == "2.7" ]]; then
echo "Installing python 2.";
brew install python@2 1>&2 || travis_terminate 1;
pip install virtualenv || travis_terminate 1;
virtualenv venv -p python2;
elif [[ $TRAVIS_PYTHON_VERSION == "3.12" ]]; then
echo "Installing python 3.";
brew install [email protected] 1>&2 || travis_terminate 1;
pip3 install virtualenv || travis_terminate 1;
virtualenv venv -p python3;
fi;
source venv/bin/activate || travis_terminate 1;
fi
- if [[ $TRAVIS_PULL_REQUEST == false && -n $TRAVIS_TAG ]]; then
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
echo "Installing pandoc.";
brew install pandoc 1>&2 || travis_terminate 1;
fi;
echo "Installing pypandoc.";
pip install pypandoc || travis_terminate 1;
fi
install:
- pip install .
script:
- python --version || travis_terminate 1
- python setup.py test || travis_terminate 1
# Need to pick a Python version to create the source distribution.
- if [[ $TRAVIS_PYTHON_VERSION == "3.12" && $TRAVIS_OS_NAME == linux && $TRAVIS_PULL_REQUEST == false && -n $TRAVIS_TAG ]]; then
echo "Creating source distribution.";
python setup.py sdist || travis_terminate 1;
else
echo "Skip creation of source distribution.";
fi
# Binary wheels for Linux that are too platform specific are not allowed to
# be uploaded on PyPI. As we need to compile C code, we only create them on OSX.
- if [[ $TRAVIS_OS_NAME == osx && $TRAVIS_PULL_REQUEST == false && -n $TRAVIS_TAG ]]; then
echo "Creating binary distribution wheel.";
python setup.py bdist_wheel || travis_terminate 1;
else
echo "Skip creation of binary distribution wheel.";
fi
deploy:
provider: releases
token:
secure: Oy5f4YjhoPd1tAFK0nlD9ZmWYH1cpnl5R3erPinemU4S/8l0jyTb4e5gdYVhluzSTZGrvNKJREwTSsq6yOriNc9EgTc/YwkFczkFuPokGzNO+VNfaEfsm9v/zcPH+Tpc51mFWXYnhFzBkJeIeRPNoVXCifFL+WxoCyWg6ljpVHg=
file_glob: true
file:
- dist/Whirlpool-*.tar.gz
- dist/Whirlpool-*.whl
on:
tags: true
jobs:
fast_finish: true
include:
# Python 3.3 is available on distro Trusty
- stage: test
language: python
python: 3.3
dist: trusty
env: TRAVIS_PYTHON_VERSION=3.3
# Python 2.7, pypy, 3.4, 3.5 and 3.6 are available on distro Xenial
- stage: test
language: python
python: 2.7
dist: xenial
env: TRAVIS_PYTHON_VERSION=2.7
- stage: test
language: python
python: pypy
dist: xenial
env: TRAVIS_PYTHON_VERSION=pypy
- stage: test
language: python
python: 3.4
dist: xenial
env: TRAVIS_PYTHON_VERSION=3.4
- stage: test
language: python
python: 3.5
dist: xenial
env: TRAVIS_PYTHON_VERSION=3.5
- stage: test
language: python
python: 3.6
dist: xenial
env: TRAVIS_PYTHON_VERSION=3.6
# Manually include OSX in the job matrix, but only for
# Python 2.7 and 3.12.
- stage: test
language: generic
python: 2.7
os: osx
osx_image: xcode12.2
env: TRAVIS_PYTHON_VERSION=2.7
- stage: test
language: generic
python: 3.12
os: osx
osx_image: xcode14.2
env: TRAVIS_PYTHON_VERSION=3.12
# As the deploy script fetches all build artifacts uploaded to GitHub of
# all stages, we only need to run it once.
# So pinning it to Python 3.12 on Linux.
- stage: deploy
python: 3.12
os: linux
cache: false
before_install: skip
install: skip
script:
- echo "Check build status."
- python .travis/travis-release.py || travis_terminate 1
- echo "Installing Twine."
- pip install twine || travis_terminate 1
- if [[ $TRAVIS_PULL_REQUEST == false && -n $TRAVIS_TAG ]]; then
if [[ $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Deploy to production PyPI.";
twine upload -r $TWINE_PROD_REPOSITORY --repository-url $TWINE_PROD_REPOSITORY_URL dist/* --skip-existing || travis_terminate 1;
else
echo "Deploy to test PyPI.";
twine upload -r $TWINE_TEST_REPOSITORY --repository-url $TWINE_TEST_REPOSITORY_URL dist/* --skip-existing || travis_terminate 1;
fi;
fi
notifications:
email:
on_success: never
on_failure: change