Skip to content

Commit

Permalink
[skyapi] refs skycoin#131 trying to fix tavis's errors
Browse files Browse the repository at this point in the history
  • Loading branch information
e1Ru1o committed Jul 1, 2019
1 parent fbfaa15 commit 0be1453
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,11 @@ jobs:
condition: $TRAVIS_OS_NAME = "osx"
- stage: skyapi
before_deploy:
- cd lib/skyapi/
- echo "Generating distribution archives before deploy"
- make sdist
- make bdist_wheel
- if [ $TRAVIS_OS_NAME == "linux" && $TOXENV == "py37" ]; then make bdist_manylinux_amd64 ; fi
- ls dist
- cd lib/skyapi/
deploy:
- provider: pypi
distributions: sdist bdist_wheel
Expand Down
2 changes: 1 addition & 1 deletion .travis/install-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ curl -sL -o "$HOME/bin/gimme" https://raw.githubusercontent.com/travis-ci/gimme/
chmod +x "$HOME/bin/gimme"

# Install Python libraries
$PIP install --upgrade pip setuptools tox-travis
$PIP install --upgrade --user pip setuptools tox-travis
$PIP install -r "$REPO_ROOT/requirements.dev.txt"
$PIP install -r "$REPO_ROOT/lib/skyapi/requirements.txt"
$PIP install -r "$REPO_ROOT/lib/skyapi/test-requirements.txt"
Expand Down
20 changes: 20 additions & 0 deletions lib/skyapi/.travis/build_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e -x

# Install system packages required by our library
yum install -y sudo pcre pcre-devel
mkdir -p "$HOME/bin"
PIP=/opt/python/cp27-cp27m/bin/pip source /io/.travis/install-linux.sh
eval "$(gimme 1.10)"

# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install -r /io/requirements.dev.txt
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done

12 changes: 12 additions & 0 deletions lib/skyapi/.travis/check_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

#!/bin/bash
set -e -x

# Code that follows assumes that wheels have been generated by build_wheels.sh

# Install packages and test
for PYBIN in /opt/python/*/bin/; do
"${PYBIN}/pip" install pyskycoin --no-index -f /io/wheelhouse
(cd /io ; "${PYBIN}/python" -m pytest --showlocals tests )
done

35 changes: 35 additions & 0 deletions lib/skyapi/.travis/install-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

set -ev

# Environment checks
if [ "$PIP" == "" ]; then
export PIP='python -m pip'
fi

# Repository root path
REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
echo "Install Linux packages from $REPO_ROOT"

# Install gimme
curl -sL -o "$HOME/bin/gimme" https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
chmod +x "$HOME/bin/gimme"

# Install Python libraries
$PIP install --upgrade --user pip setuptools tox-travis
$PIP install -r "$REPO_ROOT/requirements.dev.txt"
$PIP install -r "$REPO_ROOT/lib/skyapi/requirements.txt"
$PIP install -r "$REPO_ROOT/lib/skyapi/test-requirements.txt"

# Compile SWIG
mkdir swig_build && \
cd swig_build && \
curl -sL -o "swig-3.0.12.tar.gz" http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz && \
tar -zxf swig-3.0.12.tar.gz && \
cd swig-3.0.12 && \
sudo ./configure --prefix=/usr && \
sudo make && \
sudo make install && \
cd ../../ && \
sudo rm -rf swig_build

29 changes: 29 additions & 0 deletions lib/skyapi/.travis/install-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -ev

# Install some dependencies
brew update;
brew outdated pyenv || brew upgrade pyenv;
brew install pyenv-virtualenv
brew install swig;
brew install gimme;

# Install Python
pyenv install ${PYTHON}
pyenv install 2.7.14
pyenv global ${PYTHON} 2.7.14

# Prepare and initialize pyenv environment
eval "$(pyenv init -)";
eval "$(pyenv virtualenv-init -)";
pyenv rehash

# Setup environment and PATH in MacOS
export PYCMD_VERSION="$(echo ${PYTHON} | cut -d . -f 1,2)"
export PYCMD_PATH="$(pyenv which python${PYCMD_VERSION})"
export PYCMD_DIRPATH="$( dirname ${PYCMD_PATH} )"
export PATH="${PYCMD_DIRPATH}:/Users/travis/.pyenv/shims:${PATH}"

eval "python${PYCMD_VERSION} -m pip install --upgrade pip setuptools wheel tox tox-pyenv pytest pytest-runner"

0 comments on commit 0be1453

Please sign in to comment.