Skip to content

Travis: Build binary wheels #67

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 33 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
sudo: required
dist: trusty
language: generic
language: python
services:
- docker

cache:
directories:
- ~/.cache/pip

env:
global:
- ROCKSDB_COMMIT=479c566771d6464785f205a368701c689e094fe5
- TWINE_USERNAME=bauerj

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this should be changed to an account the maintainers control?

Copy link
Author

@bauerj bauerj Oct 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, to quote myself:

In order to automatically upload new releases to PyPi, you should make some changes before merging:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, was only reading the code :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw it's probably preferable to set username to __token__ and generate an API key specifically for travis on PyPI

- CIBW_MANYLINUX1_X86_64_IMAGE="quay.io/pypa/manylinux2010_x86_64"
- CIBW_MANYLINUX1_I686_IMAGE="quay.io/pypa/manylinux2010_i686"
- CIBW_TEST_COMMAND="rm {project}/rocksdb/tests/__init__.py; pytest {project}/rocksdb/tests"
- CIBW_TEST_REQUIRES=".[test]"
- CIBW_BUILD=*-manylinux1_x86_64

install:
docker build . -t ci-image;
- pip install cibuildwheel==0.11.1
- pip install twine
script:
docker run -v ~/.cache/pip:/home/tester/.cache/pip -v $(pwd):/home/tester/src ci-image:latest tox -e ${TOXENV} ;
env:
- TOXENV=py27
- TOXENV=py36
- TOXENV=docs
- |
export CIBW_BEFORE_BUILD="
if [ ! -d "/tmp/rocksdb" ]; then
yum install -y snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel
pushd /tmp
git clone https://github.com/facebook/rocksdb
cd rocksdb
git reset --hard $ROCKSDB_COMMIT
CXXFLAGS='-flto -Os -s' PORTABLE=1 make shared_lib -j 6
make install-shared
popd
fi
"
- cibuildwheel --output-dir wheelhouse
- ls -la wheelhouse
- |
if [[ $TRAVIS_TAG ]]; then
python -m pip install twine
python -m twine upload wheelhouse/*.whl
fi