Skip to content

Commit 548c2e5

Browse files
author
ibayer
authored
Merge pull request #125 from chezou/manylinux1-ci
Add manylinux1 build on travis
2 parents 6052892 + a9b067c commit 548c2e5

File tree

2 files changed

+112
-38
lines changed

2 files changed

+112
-38
lines changed

.travis.yml

Lines changed: 73 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,95 @@
11
language: c
22

3-
env:
4-
- TRAVIS_PYTHON_VERSION="2.7"
5-
- TRAVIS_PYTHON_VERSION="3.5"
6-
- TRAVIS_PYTHON_VERSION="3.6"
7-
8-
os:
9-
- linux
10-
- osx
3+
matrix:
4+
include:
5+
- os: osx
6+
env:
7+
- TRAVIS_PYTHON_VERSION="2.7"
8+
- DEPLOYABLE="true"
9+
- os: osx
10+
env:
11+
- TRAVIS_PYTHON_VERSION="3.5"
12+
- DEPLOYABLE="true"
13+
- os: osx
14+
env:
15+
- TRAVIS_PYTHON_VERSION="3.6"
16+
- DEPLOYABLE="true"
17+
- os: linux
18+
env:
19+
- TRAVIS_PYTHON_VERSION="2.7"
20+
- os: linux
21+
env:
22+
- TRAVIS_PYTHON_VERSION="3.5"
23+
- os: linux
24+
env:
25+
- TRAVIS_PYTHON_VERSION="3.6"
26+
- services: docker
27+
sudo: required
28+
env:
29+
- DEPLOY_TARGET="manylinux1"
30+
- DEPLOYABLE="true"
1131

1232
dist: trusty
1333

1434
before_install:
15-
# fastFM-core depends on cblas
16-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; sudo apt-get install -y libopenblas-dev; fi
17-
- if [[ "$TRAVIS_PYTHON_VERSION" =~ "^2" ]]; then
18-
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
19-
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
20-
else
21-
wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh;
22-
fi
35+
- |
36+
# Skip if manylinux1
37+
if [ "$DEPLOY_TARGET" = "manylinux1" ]; then
38+
echo "Skip before_install step..."
2339
else
24-
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
25-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
40+
# fastFM-core depends on cblas
41+
if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; sudo apt-get install -y libopenblas-dev; fi
42+
if [[ "$TRAVIS_PYTHON_VERSION" =~ "^2" ]]; then
43+
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
44+
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
45+
else
46+
wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh;
47+
fi
2648
else
27-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
49+
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
50+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
51+
else
52+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
53+
fi
2854
fi
55+
bash miniconda.sh -b -p $HOME/miniconda
56+
export PATH="$HOME/miniconda/bin:$PATH"
57+
hash -r
58+
conda config --set always_yes yes --set changeps1 no
59+
conda update -q conda
60+
# Useful for debugging any issues with conda
61+
conda info -a
62+
conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION cython numpy pandas scipy scikit-learn nose
63+
source activate test-environment
2964
fi
30-
- bash miniconda.sh -b -p $HOME/miniconda
31-
- export PATH="$HOME/miniconda/bin:$PATH"
32-
- hash -r
33-
- conda config --set always_yes yes --set changeps1 no
34-
- conda update -q conda
35-
# Useful for debugging any issues with conda
36-
- conda info -a
37-
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION cython numpy pandas scipy scikit-learn nose
38-
- source activate test-environment
3965
4066
install:
41-
- git submodule update --init --recursive
42-
- make
43-
- python setup.py bdist_wheel
44-
- pip install dist/*.whl
67+
- |
68+
git submodule update --init --recursive
69+
if [ "$DEPLOY_TARGET" = "manylinux1" ]; then
70+
:
71+
else
72+
make
73+
python setup.py bdist_wheel
74+
pip install dist/*.whl
75+
fi
4576
4677
script:
47-
- nosetests
48-
49-
before_deploy:
50-
- export RELEASE_PKG_FILE=$(ls dist/*.whl)
51-
- echo "deploying $RELEASE_PKG_FILE to GitHub releases"
78+
- |
79+
if [ "$DEPLOY_TARGET" = "manylinux1" ]; then
80+
#build for 64-bit
81+
docker run --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/.travis/build-wheels.sh
82+
else
83+
nosetests
84+
fi
5285
5386
deploy:
5487
provider: releases
5588
api_key:
5689
secure: AJcZoe2+OiMJ4VlSkASAeMc/ii0ZRnj2PFaaL7zlSbx1THMpY/49U5BSyqX1PQioPSlTV3ZsIXI3u7KyqoXIQSXWzAuaBzpLTLS85fGSuTvUuexmaJtKU92OC143tuVVLCPnjC992+1uyctjrxMSqgoaUolfYkEftt5RGrMIKl2duGfDXrPXIueHSl8FQGXkmlY6NqkRx2v5kxsAjFcurvwTNU8ptJ84jVKjrE6t1IB61vp2eUcqVR/z6Lwau6mdvIybglnbH4lCMXP98zEIibLA8vbn3XxrC+0uU7Kjz37K6/CsJEPNL5tujJDMRKAupnrkgPsAGTpsAn6O6uLUz0ISgcen8R6KJ7cBli+cq08OZ3JLLoJpqkni62YVSQV+uYkQk9b5Pu09vUTOozJMnOqLSj9hVIswyxGiFPcTFskMgqMdx15M59gd0YpXH633YqwBgRmWNsctp4BKnTaE3iGW6aZc8lrXxpL7qcVAosjmpjLp3jiPXVSRdYf0yHl6pDUj5ZVyu27kAn1/I9JL0nH19zjXF2tUlEjuT9ydHwnhmsgBN/V+JhZxi7ZeEbOZfY1MfekKM/NwSRehVEp/J0XWqWg+kIXRU/rqY1/w0vLVNFeQirpEjUp39eCBydXeS3Bik8uANW2UTxojJo3LBfLLoAT8ZWFb3YrIBAYkzjc=
57-
file: "${RELEASE_PKG_FILE}"
90+
file_glob: true
91+
file: dist/fastFM-*.whl
5892
skip_cleanup: true
5993
on:
6094
tags: true
95+
condision: $DEPLOYEABLE = "true"

.travis/build-wheels.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
#
3+
#Author: Likhith Chitneni
4+
#License: BSD 3 Clause license - https://opensource.org/licenses/BSD-3-Clause
5+
#
6+
7+
set -e -x
8+
9+
# Install any system packages required here
10+
#yum install -y $PACKAGE_TO_BE_INSTALLED
11+
12+
#Remove Python 2.6 and 3.3 since numpy requires >=2.7 or >=3.4
13+
rm -rf /opt/python/cpython-2.6.9-*
14+
rm -rf /opt/python/cp33-cp33m
15+
16+
#Make fastFM-core
17+
cd /io/fastFM-core
18+
make clean && make
19+
cd /
20+
21+
#Compile wheels
22+
for PYBIN in /opt/python/*/bin; do
23+
"${PYBIN}/pip" install -r /io/requirements.txt
24+
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
25+
done
26+
27+
# Bundle external shared libraries into the wheels
28+
for whl in wheelhouse/*.whl; do
29+
auditwheel repair "$whl" -w /io/wheelhouse/
30+
done
31+
32+
# Install packages and test
33+
for PYBIN in /opt/python/*/bin; do
34+
"${PYBIN}/pip" install fastFM --no-index -f /io/wheelhouse
35+
"${PYBIN}/pip" install nose
36+
(cd "$HOME"; "${PYBIN}/nosetests" /io/fastFM/tests)
37+
done
38+
39+
mv /io/wheelhouse /io/dist

0 commit comments

Comments
 (0)