Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add .travis.yml for Travis CI (http://travis-ci.org/) #292

Merged
merged 2 commits into from

2 participants

@msabramo

Here's the status of my fork -- Build Status -- http://travis-ci.org/msabramo/numpy

The PyPy build is failing for some reason -- I'm too tired to see why.

Here's the status of a branch without PyPy, because I like green -- Build Status

@njsmith
Owner

PyPy is failing because numpy and PyPy can't work together :-) You should just remove that test.

Testing against Python 2.4 would be very good too -- 2.4 incompatibilities are possibly the single most common bug in numpy pull requests. Unfortunately Travis does not make this easy. You'll want to add something like

env:
  - OVERRIDE_PYTHON_VERSION=2.4
  - OVERRIDE_PYTHON_VERSION=

matrix:
  exclude:
    - python: 2.6
      env: OVERRIDE_PYTHON_VERSION=2.4
    # repeat for all-but-one python version

And then you can extract the necessary logic for handling that variable from here:
https://github.com/charlton/charlton/blob/master/.travis-make-py24-virtualenv.sh
https://github.com/charlton/charlton/blob/master/.travis.yml

@msabramo

OK, I removed PyPy and I'm toying around a bit with 2.4 stuff on another branch. If I get it working, I'll submit a PR for that.

@msabramo

In 1a050bb, I went ahead and updated the Travis CI config so it does the hackiness to support testing Python 2.4 -- see Build Status -- http://travis-ci.org/msabramo/numpy

@njsmith
Owner

Excellent that you got Python 2.4 working. But the .travis.yml in this push request now has a bunch of confusing stuff about NUMPY_VERSION=1.2.1 and mentions of "charlton" and no more Python 3 tests...

@njsmith
Owner

FYI travis just added support for "matrix: include:", which makes it much more straightforward to support Python 2.4.

@msabramo msabramo Simpler .travis.yml to test everything from py2.4 to py3.2
Uses Travis's new "matrix: include:" feature which makes
"the 2.4 hack" more straightforward.
9e2c5af
@msabramo

With 9e2c5af, here's passing builds on Travis for everything from Python 2.4 to Python 3.2!

http://travis-ci.org/#!/msabramo/numpy/builds/1635511

@njsmith njsmith merged commit 9e2c5af into from
@njsmith
Owner

Err, meant to paste this link, actually: http://travis-ci.org/#!/numpy/numpy

@msabramo

Awesome! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 6, 2012
  1. @msabramo
Commits on Jun 16, 2012
  1. @msabramo

    Simpler .travis.yml to test everything from py2.4 to py3.2

    msabramo authored
    Uses Travis's new "matrix: include:" feature which makes
    "the 2.4 hack" more straightforward.
This page is out of date. Refresh to see the latest.
Showing with 72 additions and 0 deletions.
  1. +18 −0 .travis-make-py24-virtualenv.sh
  2. +54 −0 .travis.yml
View
18 .travis-make-py24-virtualenv.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+VIRTENV=$1
+
+set -x
+set -e
+
+curl -O http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tar.bz2
+tar xjf Python-2.4.6.tar.bz2
+cd Python-2.4.6
+cat >setup.cfg <<EOF
+[build_ext]
+library_dirs=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/
+EOF
+./configure --prefix=$PWD/install
+make
+make install
+virtualenv -p install/bin/python2.4 --distribute $VIRTENV
View
54 .travis.yml
@@ -0,0 +1,54 @@
+# After changing this file, check it on:
+# http://lint.travis-ci.org/
+language: python
+python:
+ - 2.5
+ - 2.6
+ - 2.7
+ - 3.2
+env:
+ # Hack:
+ #
+ # We want to test from Python 2.4 to Python 3.2
+ # but Travis doesn't support python 2.4, and never will:
+ # https://github.com/travis-ci/travis-ci/issues/485
+ #
+ # So what we do is add TEST_PY24=true to the build matrix, and then for that one
+ # version we don't actually use the system python, but instead build 2.4 and
+ # use it.
+ #
+ - TEST_PY24=""
+matrix:
+ include:
+ - python: 2.5
+ env: TEST_PY24="true"
+before_install:
+ - mkdir builds
+ - pushd builds
+ # This has to be on a single "virtual line" because of how Travis
+ # munges each line before executing it to print out the exit status.
+ # It's okay for it to be on multiple physical lines, so long as you remember:
+ # - There can't be any leading "-"s
+ # - All newlines will be removed, so use ";"s
+ - if [ "${TEST_PY24}" == "true" ]; then
+ deactivate;
+ ../.travis-make-py24-virtualenv.sh $PWD/py24-ve;
+ source $PWD/py24-ve/bin/activate;
+ fi
+ - pip install nose
+ # pip install coverage
+ - python -V
+ - popd
+install:
+ - python setup.py install
+script:
+ # We change directories to make sure that python won't find the copy
+ # of numpy in the source directory.
+ - mkdir empty
+ - cd empty
+ - INSTALLDIR=$(python -c "import os; import numpy; print(os.path.dirname(numpy.__file__))")
+ - export PYTHONWARNINGS=default
+ - python ../tools/test-installed-numpy.py
+ # - coverage run --source=$INSTALLDIR --rcfile=../.coveragerc $(which python) ../tools/test-installed-numpy.py
+ # - coverage report --rcfile=../.coveragerc --show-missing
+
Something went wrong with that request. Please try again.