https://github.com/astropy/astropy
Raw File
Tip revision: 5cafcd7f5cfbcc483091cc29b0dae8a7b813dc69 authored by Erik M. Bray on 04 March 2014, 17:48:30 UTC
Preparing release 0.3.1
Tip revision: 5cafcd7
.travis.yml
language: python

python:
    - 2.6
    - 2.7
    - 3.2
    - 3.3
    # This is just for "egg_info".  All other builds are explicitly given in the matrix
env:
    global:
        - PIP_WHEEL_COMMAND="pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel --use-mirrors"
    matrix:
        - SETUP_CMD='egg_info' NUMPY_VERSION=1.7.1 OPTIONAL_DEPS=false

matrix:
    include:

        # Do a coverage test in Python 2
        - python: 2.7
          env: NUMPY_VERSION=1.7.1 SETUP_CMD='test --coverage' OPTIONAL_DEPS=true

        # Check for sphinx doc build warnings - we do this first because it
        # runs for a long time
        - python: 2.7
          env: SETUP_CMD='build_sphinx -w -n' NUMPY_VERSION=1.8.0 OPTIONAL_DEPS=true
          # OPTIONAL_DEPS needed because the plot_directive in sphinx needs them

        # Try all python versions with the latest numpy
        - python: 2.6
          env: SETUP_CMD='test --parallel=8' NUMPY_VERSION=1.7.1 OPTIONAL_DEPS=false
        - python: 2.7
          env: SETUP_CMD='test --parallel=8' NUMPY_VERSION=1.7.1 OPTIONAL_DEPS=false
        # There is a bug in pytest-xdist that prevents it from working
        # on Python 3.x.  See:
        # https://bitbucket.org/hpk42/pytest/issue/301/internal-error-during-test-collecting
        - python: 3.2
          env: SETUP_CMD='test' NUMPY_VERSION=1.7.1 OPTIONAL_DEPS=false
        - python: 3.3
          env: SETUP_CMD='test' NUMPY_VERSION=1.7.1 OPTIONAL_DEPS=false

        # Now try do scipy on 2.7 and an appropriate 3.x build (with latest numpy)
        - python: 2.7
          env: SETUP_CMD='test --parallel=8' NUMPY_VERSION=1.7.1 OPTIONAL_DEPS=true LC_CTYPE=C.ascii
        - python: 3.2
          env: SETUP_CMD='test' NUMPY_VERSION=1.7.1 OPTIONAL_DEPS=true LC_CTYPE=C.ascii

        # Try alternate numpy versions
        - python: 2.7
          env: NUMPY_VERSION=1.6.2 SETUP_CMD='test --parallel=8' OPTIONAL_DEPS=false
        - python: 3.2
          env: NUMPY_VERSION=1.6.2 SETUP_CMD='test --parallel=8' OPTIONAL_DEPS=false
        - python: 2.7
          env: NUMPY_VERSION=1.5.1 SETUP_CMD='test --parallel=8' OPTIONAL_DEPS=false

before_install:

    # Use utf8 encoding. Should be default, but this is insurance against
    # future changes
    - export PYTHONIOENCODING=UTF8

    # Install the pip that supports wheel
    - pip install setuptools --upgrade
    - pip install pip --upgrade
    - pip install wheel

    # We do this to make sure we get dependencies so pip works below
    # Note that travis does *not* use python packages installed via apt - it
    # does all the building in an isolated virtualenv
    - sudo apt-get update

    # CORE DEPENDENCIES
    - if [[ $SETUP_CMD != egg_info ]]; then sudo apt-get install python-numpy cython libatlas-dev liblapack-dev gfortran; fi

    # OPTIONAL DEPENDENCIES
    - if $OPTIONAL_DEPS; then sudo apt-get install python-scipy libhdf5-serial-1.8.4 libhdf5-serial-dev; fi

    # DOCUMENTATION DEPENDENCIES
    - if [[ $SETUP_CMD == build_sphinx* ]]; then sudo apt-get install python-sphinx graphviz texlive-latex-extra dvipng python-matplotlib; fi


install:

    # CORE DEPENDENCIES
    # These command run pip first trying a wheel, and then falling back on
    # source build
    - if [[ $SETUP_CMD != egg_info ]]; then $PIP_WHEEL_COMMAND --upgrade "numpy==$NUMPY_VERSION"; fi
    - if [[ $SETUP_CMD != egg_info ]]; then $PIP_WHEEL_COMMAND "Cython>=0.18"; fi
    - if [[ $SETUP_CMD != egg_info ]]; then $PIP_WHEEL_COMMAND "pytest==2.4.0"; fi
    - if [[ $SETUP_CMD != egg_info ]]; then $PIP_WHEEL_COMMAND "pytest-xdist==1.8"; fi

    # OPTIONAL DEPENDENCIES
    - if $OPTIONAL_DEPS; then $PIP_WHEEL_COMMAND "scipy==0.12.0"; fi
    - if $OPTIONAL_DEPS; then $PIP_WHEEL_COMMAND "h5py==2.1.3"; fi

    # DOCUMENTATION DEPENDENCIES
    # build_sphinx needs sphinx and matplotlib (for plot_directive). Note that
    # this matplotlib will *not* work with py 3.x, but our sphinx build is
    # currently 2.7, so that's fine
    - if [[ $SETUP_CMD == build_sphinx* ]]; then $PIP_WHEEL_COMMAND "Sphinx==1.2b3"; fi
    - if [[ $SETUP_CMD == build_sphinx* ]]; then $PIP_WHEEL_COMMAND "matplotlib>=1.3.0"; fi

    # COVERAGE DEPENDENCIES
    - if [[ $SETUP_CMD == 'test --coverage' ]]; then $PIP_WHEEL_COMMAND "pytest-cov" ; fi
    - if [[ $SETUP_CMD == 'test --coverage' ]]; then $PIP_WHEEL_COMMAND "coveralls"; fi

script:
    - python setup.py $SETUP_CMD

after_success:
  - if [[ $SETUP_CMD == 'test --coverage' ]]; then coveralls; fi

back to top