Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test under macOS and publish wheels #14

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 27 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ env:

matrix:
include:
- python: "2.7"
env: TOXENV=py27-flake8
- python: "3.7"
env: TOXENV=py37-flake8
- python: "2.7"
env: TOXENV=py27
- python: "3.4"
Expand All @@ -32,15 +36,33 @@ matrix:
env: TOXENV=py36
- python: "3.7"
env: TOXENV=py37
- python: "2.7"
env: TOXENV=py27-flake8
- python: "3.7"
env: TOXENV=py37-flake8
- os: osx
# No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312
language: generic
env: TOXENV=py27
- os: osx
language: generic
env: TOXENV=py35
phdru marked this conversation as resolved.
Show resolved Hide resolved
- os: osx
language: generic
env: TOXENV=py36
- os: osx
language: generic
env: TOXENV=py37
- python: "pypy2.7-6.0"
env: TOXENV=pypy

fast_finish: true

before_install:
- |
if [ "$TRAVIS_OS_NAME" == 'osx' -a "$TOXENV" != "py27" ]; then
curl -O https://repo.anaconda.com/miniconda/Miniconda2-latest-MacOSX-x86_64.sh
nsoranzo marked this conversation as resolved.
Show resolved Hide resolved
bash Miniconda2-latest-MacOSX-x86_64.sh -b -p "$HOME/miniconda2"
REQUIRED_PYTHON_VERSION=$(python -c "import os; toxenv = os.environ['TOXENV']; print('.'.join(list(toxenv[2:])))")
~/miniconda2/bin/conda create -y -n "$TOXENV" python="$REQUIRED_PYTHON_VERSION"
. ~/miniconda2/bin/activate "$TOXENV"
fi

install:
- travis_retry pip install --upgrade "pip < 19.1" setuptools tox ppu

Expand Down
44 changes: 25 additions & 19 deletions devscripts/CI/travisci-release
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env bash
set -e

[[ "$TOXENV" == *-flake8 || "$TOXENV" == pypy* ]] && exit 0

Expand All @@ -15,25 +16,30 @@ python -m compileall build &&
python -O -m compileall build &&
python setup.py bdist_wheel &&

py=`python -c "import sys; print('.'.join(sys.version.split('.')[:2]))"`
v="`echo $py | sed 's/\.//'`" &&

if [ $py = 2.7 ]; then
pyenv global system 3.6.7 2.7.15
pip3.6 install -U auditwheel
else
pip install -U auditwheel
py=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))")
v=$(echo "$py" | sed 's/\.//') &&

if [ "$TRAVIS_OS_NAME" == 'linux' ]; then
if [ "$py" == 2.7 ]; then
pyenv global system 3.6.7 2.7.15
pip3.6 install -U auditwheel
else
pip install -U auditwheel
fi &&

for f in dist/Cheetah3-*-cp$v-*-linux_x86_64.whl; do
if [ "$py" == 2.7 ]; then
python3.6 -m auditwheel repair -w dist/ "$f"
else
python -m auditwheel repair -w dist/ "$f"
fi &&
rm -f "$f"
done
else # osx
pip install -U delocate
for f in dist/Cheetah3-*-cp$v-*-macosx*.whl; do
delocate-wheel -v "$f"
done
fi &&

cd dist &&
for f in Cheetah3-*-cp$v-*-linux_x86_64.whl; do
if [ $py = 2.7 ]; then
python3.6 -m auditwheel repair -w . $f
else
python -m auditwheel repair -w . $f
fi &&
rm $f
done &&
cd .. &&

exec twine upload --skip-existing dist/*