<commit_before>#!/bin/bash
set -e -x

bash --version

cd /io

source travis/travis_retry.sh

# List python versions
ls /opt/python

PYBINS=(
  "/opt/python/cp27-cp27mu/bin"
  "/opt/python/cp34-cp34m/bin"
  "/opt/python/cp35-cp35m/bin"
  "/opt/python/cp36-cp36m/bin"
  )

# Install build tools
travis_retry yum install -y cmake28 # CentOS cmake is 2.6, we need >= 2.8 which is available from EPEL as cmake28
ln -s /usr/bin/cmake28 /usr/bin/cmake

# Install liblensfun
pushd external/lensfun
cmake . -DBUILD_TESTS=off
make install
echo "/usr/local/lib64" | tee /etc/ld.so.conf.d/99local.conf
ldconfig
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
popd

# Install numpy/scipy deps
travis_retry yum install -y lapack-devel blas-devel

# Build lensfunpy wheels
for PYBIN in ${PYBINS[@]}; do
    case ${PYBIN} in
        *27*) NUMPY_VERSION="1.7.2";;
        *34*) NUMPY_VERSION="1.8.*";;
        *35*) NUMPY_VERSION="1.9.*";;
        *36*) NUMPY_VERSION="1.11.*";;
    esac

    # install compile-time dependencies
    travis_retry ${PYBIN}/pip install numpy==${NUMPY_VERSION} cython

    travis_retry ${PYBIN}/pip wheel . -w wheelhouse
done

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

# Remove lensfun lib again to verify it works without
pushd external/lensfun
# CMake stores install_manifest.txt, see https://stackoverflow.com/a/44649542.
xargs rm < install_manifest.txt
popd

# Build sdist
${PYBINS[0]}/python setup.py sdist

# Install packages and test
for PYBIN in ${PYBINS[@]}; do
    ${PYBIN}/pip install lensfunpy --no-index -f wheelhouse

    travis_retry ${PYBIN}/pip install -r dev-requirements.txt
    travis_retry ${PYBIN}/pip install numpy -U # scipy should trigger an update, but that doesn't happen

    pushd $HOME
    ${PYBIN}/nosetests --verbosity=3 --nocapture /io/test
    popd
done

# Move wheels to dist/ folder for easier deployment
mv wheelhouse/lensfunpy*manylinux1*.whl dist/

# deploy if git tag
# make first python available so that the deploy script can use twine
export PATH=${PYBINS[0]}:$PATH
travis/deploy_pypi.sh<commit_msg>dump install_manifest.txt for CI debugging<commit_after>#!/bin/bash
set -e -x

bash --version

cd /io

source travis/travis_retry.sh

# List python versions
ls /opt/python

PYBINS=(
  "/opt/python/cp27-cp27mu/bin"
  "/opt/python/cp34-cp34m/bin"
  "/opt/python/cp35-cp35m/bin"
  "/opt/python/cp36-cp36m/bin"
  )

# Install build tools
travis_retry yum install -y cmake28 # CentOS cmake is 2.6, we need >= 2.8 which is available from EPEL as cmake28
ln -s /usr/bin/cmake28 /usr/bin/cmake

# Install liblensfun
pushd external/lensfun
cmake . -DBUILD_TESTS=off
make install
echo "/usr/local/lib64" | tee /etc/ld.so.conf.d/99local.conf
ldconfig
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
popd

# Install numpy/scipy deps
travis_retry yum install -y lapack-devel blas-devel

# Build lensfunpy wheels
for PYBIN in ${PYBINS[@]}; do
    case ${PYBIN} in
        *27*) NUMPY_VERSION="1.7.2";;
        *34*) NUMPY_VERSION="1.8.*";;
        *35*) NUMPY_VERSION="1.9.*";;
        *36*) NUMPY_VERSION="1.11.*";;
    esac

    # install compile-time dependencies
    travis_retry ${PYBIN}/pip install numpy==${NUMPY_VERSION} cython

    travis_retry ${PYBIN}/pip wheel . -w wheelhouse
done

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

# Remove lensfun lib again to verify it works without
pushd external/lensfun
# CMake stores install_manifest.txt, see https://stackoverflow.com/a/44649542.
cat install_manifest.txt
xargs rm < install_manifest.txt
ls -al /usr/local/lib64/liblensfun*
popd

# Build sdist
${PYBINS[0]}/python setup.py sdist

# Install packages and test
for PYBIN in ${PYBINS[@]}; do
    ${PYBIN}/pip install lensfunpy --no-index -f wheelhouse

    travis_retry ${PYBIN}/pip install -r dev-requirements.txt
    travis_retry ${PYBIN}/pip install numpy -U # scipy should trigger an update, but that doesn't happen

    pushd $HOME
    ${PYBIN}/nosetests --verbosity=3 --nocapture /io/test
    popd
done

# Move wheels to dist/ folder for easier deployment
mv wheelhouse/lensfunpy*manylinux1*.whl dist/

# deploy if git tag
# make first python available so that the deploy script can use twine
export PATH=${PYBINS[0]}:$PATH
travis/deploy_pypi.sh
{'fraction_non_alphanumeric': 0.11687130513869941, 'fraction_numerical': 0.0286493860845839, 'mean_word_length': 3.664899257688229, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6574333', 'n_tokens_mistral': 1690, 'n_tokens_neox': 1607, 'n_words': 448}