[segyio] 296/376: Build & distribute binaries with Travis

Jørgen Kvalsvik jokva-guest at moszumanska.debian.org
Wed Sep 20 08:04:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

jokva-guest pushed a commit to branch debian
in repository segyio.

commit 8aef04c17e6f9062abe7b15467b444a0144c0858
Author: Jørgen Kvalsvik <jokva at statoil.com>
Date:   Wed May 3 12:40:20 2017 +0200

    Build & distribute binaries with Travis
    
    Build and upload python wheel packages to pypi with Travis. This uses
    the multibuild scripts and python environments, docker, and drops the
    use of conda both for OS X and linux.
---
 .travis.yml | 114 +++++++++++++++++++++++++++++++++++++++++++-----------------
 config.sh   |   5 +++
 2 files changed, 88 insertions(+), 31 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index cb41244..889a537 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,11 +1,14 @@
-language: generic
+language: python
 
 env:
-  - BUILD_TYPE=RELEASE; PYTHON=2.7;
-  - BUILD_TYPE=RELEASE; PYTHON=3.5;
-  - BUILD_TYPE=DEBUG; PYTHON=2.7;
-  - BUILD_TYPE=DEBUG; PYTHON=3.5;
-
+    global:
+        - UNICODE_WIDTH=32
+        - PLAT=x86_64
+    matrix:
+        - MB_PYTHON_VERSION=2.7
+        - MB_PYTHON_VERSION=3.4
+        - MB_PYTHON_VERSION=3.5
+        - MB_PYTHON_VERSION=3.6
 os:
   - linux
   - osx
@@ -14,54 +17,69 @@ compiler:
   - gcc
   - clang
 
+services: docker
+sudo: required
+
 matrix:
+    fast_finish: true
     exclude:
         - os: osx
-          compiler: gcc
         - os: linux
           compiler: clang
+    include:
+        - os: osx
+          language: generic
+          env: MB_PYTHON_VERSION=2.7
+        - os: osx
+          language: generic
+          env: MB_PYTHON_VERSION=3.4
+        - os: osx
+          language: generic
+          env: MB_PYTHON_VERSION=3.5
+        - os: osx
+          language: generic
+          env: MB_PYTHON_VERSION=3.6
 
 addons:
     apt:
       sources:
         - sourceline: 'ppa:sisib/ci-backports'
+        - george-edison55-precise-backports # cmake 3
       packages:
         - valgrind
         - cppcheck
+        - cmake
+        - cmake-data
+
+before_install:
+    - source multibuild/common_utils.sh
+    - source multibuild/travis_steps.sh
+    - before_install
 
 install:
-  # Valgrind is experimental(ish) on MacOS with false positives on among others printf
-  #- if [[ "$TRAVIS_OS_NAME" == "osx" && "$BUILD_TYPE" == "DEBUG" ]]; then
-  #    brew update;
-  #    brew install --HEAD valgrind;
-  #  fi
+  # on os x, python is set up in a virtualenv, but cmake tends to find a
+  # system-installed, incompatible python lib.
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
-      export CONDA_OS=MacOSX;
-      brew update && brew install cppcheck;
-    else
-      export CONDA_OS=Linux;
-    fi
-  - if [[ "$PYTHON" == "2.7" ]]; then
-        wget https://repo.continuum.io/miniconda/Miniconda2-latest-${CONDA_OS}-x86_64.sh -O miniconda.sh;
-    else
-        wget https://repo.continuum.io/miniconda/Miniconda3-latest-${CONDA_OS}-x86_64.sh -O miniconda.sh;
+        brew update && brew install cppcheck;
+        if [[ -n "${MB_PYTHON_VERSION+1}" ]]; then
+            prefix=`python-config --prefix`;
+            pypath=$prefix/lib/libpython$MB_PYTHON_VERSION.dylib;
+            pylib="-DPYTHON_LIBRARY=$pypath";
+        fi
     fi
-  - bash miniconda.sh -b -p $HOME/miniconda
-  - export PATH="$HOME/miniconda/bin:$PATH"
-  - hash -r
-  - conda config --set always_yes yes --set changeps1 no
-  - conda update -q conda
-  - conda info -a
-
-  - conda install numpy cmake
+  - pip install numpy --upgrade
 
 before_script:
   - enabled="-DBUILD_PYTHON=OFF -DBUILD_MEX=OFF"
-  - if [[ -n "${PYTHON+1}" ]]; then enabled="$enabled -DBUILD_PYTHON=ON"; fi
+  - if [[ -n "${MB_PYTHON_VERSION+1}" ]]; then
+        enabled="$enabled -DBUILD_PYTHON=ON";
+    fi
   - cmake --version
   - mkdir build
   - pushd build
-  - cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_SHARED_LIBS=ON $enabled  ..
+  - cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
+          -DBUILD_SHARED_LIBS=ON
+          $pylib $enabled ..
   - cppcheck --language=c
              --std=c99
              --enable=style,portability,performance,warning
@@ -71,5 +89,39 @@ before_script:
              --inline-suppr
              --project=compile_commands.json
              --error-exitcode=1
+  - popd
 script:
+  - pushd build
   - make && ctest --output-on-failure
+  - cat python/setup.py
+  - popd
+  - BUILD_COMMANDS=build_bdist_wheel build_wheel build/python
+  - install_run $PLAT
+  - mv wheelhouse build/python/dist
+
+before_deploy:
+    - pushd build/python
+
+after_deploy:
+    - popd
+
+deploy:
+    - provider: pypi # source distribution (done from linux python 3.6 only)
+      skip_cleanup: true
+      skip_upload_docs: true
+      user: statoil-travis
+      password:
+        secure: WHeA5x2iiXzjYXdgZeJU6l4fawRi/umqH1713QAj0RPZBAnD+9m8Zrpn2UWn9+1dtx6xUMkNg3ZTueVKTKo0f2i/4o0xkzQ5BW11cetCWusV2Dku1btPTA5Fhs+dvPDlL3m496a3Bq/A/fRDj5JLDiiPibvpM01lEBxFKYooWGQ75HVuhnAt57vabD45gDpIE7N23+So4+9bsG/nT/ZlgoaS01uLTdlnf6tjNgP0/UBkonmedC62iVvCu7itfHZMTY2rSeww7KBMI3s7Gz+cyx9IbI3shbDpdJGHpM8Qe+1oFi31Z+DylWQA5SkpHlLMUP+zjMKLF+1hXGNUeJuyadIFrxzbS3vTV2yRPa6ol8q+bX7YLy0xNLSE8aMm54LKgXfRKLc3G8d3I33oEfyk5hygY8iEX728r2TsARslYxOF3sZqJvY8lx4GBEDiXxX2GJvGCPy/Uby786uWnZlFFkDERk3n [...]
+      on:
+        condition: $TRAVIS_OS_NAME == linux && $MB_PYTHON_VERSION == 3.6
+        tags: true
+
+    - provider: pypi # upload built wheels
+      skip_cleanup: true
+      skip_upload_docs: true
+      user: statoil-travis
+      distributions: build
+      password:
+        secure: WHeA5x2iiXzjYXdgZeJU6l4fawRi/umqH1713QAj0RPZBAnD+9m8Zrpn2UWn9+1dtx6xUMkNg3ZTueVKTKo0f2i/4o0xkzQ5BW11cetCWusV2Dku1btPTA5Fhs+dvPDlL3m496a3Bq/A/fRDj5JLDiiPibvpM01lEBxFKYooWGQ75HVuhnAt57vabD45gDpIE7N23+So4+9bsG/nT/ZlgoaS01uLTdlnf6tjNgP0/UBkonmedC62iVvCu7itfHZMTY2rSeww7KBMI3s7Gz+cyx9IbI3shbDpdJGHpM8Qe+1oFi31Z+DylWQA5SkpHlLMUP+zjMKLF+1hXGNUeJuyadIFrxzbS3vTV2yRPa6ol8q+bX7YLy0xNLSE8aMm54LKgXfRKLc3G8d3I33oEfyk5hygY8iEX728r2TsARslYxOF3sZqJvY8lx4GBEDiXxX2GJvGCPy/Uby786uWnZlFFkDERk3n [...]
+      on:
+        tags: true
diff --git a/config.sh b/config.sh
new file mode 100644
index 0000000..0323392
--- /dev/null
+++ b/config.sh
@@ -0,0 +1,5 @@
+function run_tests {
+    python -c "import segyio; print(segyio.__version__)"
+    cp -r ../test-data .
+    python -m unittest discover -vs ../python/test -p "*.py"
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/segyio.git



More information about the debian-science-commits mailing list