Skip to content

Commit

Permalink
Merge pull request #210 from jchodera/master
Browse files Browse the repository at this point in the history
Add testing for py35
  • Loading branch information
jchodera committed Feb 12, 2016
2 parents 9c4acd6 + 5876dac commit a60ca61
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 41 deletions.
37 changes: 26 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
language: c

branches:
only:
- master
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++
- gfortran
- valgrind
- csh
- g++-multilib
- gcc-multilib

install:
- source devtools/ci/install.sh
- source devtools/travis-ci/install.sh
- export PYTHONUNBUFFERED=true
- export CC=gcc
- export CXX=g++

script:
# this builds the binary, unpacks it, and runs the tests
- conda config --add channels ${ORGNAME}
- conda build devtools/conda-recipe

- source activate _test
- conda install --yes --quiet pip nose nose-timer
- cd devtools && nosetests $PACKAGENAME --nocapture --verbosity=2 --with-doctest --with-timer && cd ..
env:
matrix:
- CONDA_PY=2.7
- CONDA_PY=3.3
- CONDA_PY=3.4
- python=2.7 CONDA_PY=27
- python=3.4 CONDA_PY=34
- python=3.5 CONDA_PY=35

global:
- ORGNAME="omnia"
- PACKAGENAME="pymbar"
# encrypted BINSTAR_TOKEN for push of dev package to binstar
- secure: "lu3EsyPF+woAABbZyctdFUPfTkAUOyC7k7LsDmWBMrV6ctpvYkomDFS65NAElXDOnmPzxMpn4+f0V2+tNqD4sM/9erDfM2MkJH+tRznNkAAZFoxbxeZCmzV4zSzNvAKlopasHSXt2mbhzbDnhrIToAssQZMHp13pNlBMEq86hKc="

after_success:
- source devtools/ci/after_sucess.sh
- echo "after_success"
- ./devtools/travis-ci/after_success.sh
21 changes: 0 additions & 21 deletions devtools/ci/after_sucess.sh

This file was deleted.

4 changes: 2 additions & 2 deletions devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requirements:
- numpy
- scipy
- setuptools
- numexpr
- numexpr
- six
run:
- python
Expand All @@ -24,7 +24,7 @@ test:
requires:
- nose
- setuptools
- statsmodels
- statsmodels
imports:
- pymbar
commands:
Expand Down
36 changes: 36 additions & 0 deletions devtools/travis-ci/after_success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# Must be invoked with $PACKAGENAME

echo $TRAVIS_PULL_REQUEST $TRAVIS_BRANCH
PUSH_DOCS_TO_S3=false

if [ "$TRAVIS_PULL_REQUEST" = true ]; then
echo "This is a pull request. No deployment will be done."; exit 0
fi


if [ "$TRAVIS_BRANCH" != "master" ]; then
echo "No deployment on BRANCH='$TRAVIS_BRANCH'"; exit 0
fi


# Deploy to binstar
conda install --yes anaconda-client jinja2
binstar -t $BINSTAR_TOKEN upload --force -u ${ORGNAME} -p ${PACKAGENAME}-dev $HOME/miniconda/conda-bld/*/${PACKAGENAME}-dev-*.tar.bz2

if [ $PUSH_DOCS_TO_S3 = true ]; then
# Create the docs and push them to S3
# -----------------------------------
conda install --yes pip
conda config --add channels http://conda.binstar.org/omnia
conda install --yes `conda build devtools/conda-recipe --output`
pip install numpydoc s3cmd msmb_theme
conda install --yes `cat docs/requirements.txt | xargs`

conda list -e

(cd docs && make html && cd -)
ls -lt docs/_build
pwd
python devtools/ci/push-docs-to-s3.py
fi
1 change: 1 addition & 0 deletions devtools/travis-ci/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><head><meta http-equiv="refresh" content="0;URL='/latest'"/></head></html>
17 changes: 10 additions & 7 deletions devtools/ci/install.sh → devtools/travis-ci/install.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#!/bin/bash
pushd .

# Install Miniconda
cd $HOME
MINICONDA=Miniconda-latest-Linux-x86_64.sh
MINICONDA_MD5=$(curl -s http://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
wget http://repo.continuum.io/miniconda/$MINICONDA
if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then
echo "Miniconda MD5 mismatch"
exit 1
fi
bash $MINICONDA -b
PIP_ARGS="-U"
bash $MINICONDA -b -p miniconda

sudo ln -s /usr/bin/g++ /usr/bin/g++44
# Configure miniconda
export PATH=$HOME/miniconda/bin:$PATH
conda install --yes conda-build jinja2 anaconda-client pip
conda config --add channels omnia

conda update --yes conda
conda config --add channels http://conda.binstar.org/omnia
conda install --yes conda-build

popd
39 changes: 39 additions & 0 deletions devtools/travis-ci/push-docs-to-s3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import os
import pip
import tempfile
import subprocess
import pymbar.version


BUCKET_NAME = 'pymbar.org'
if not pymbar.version.release:
PREFIX = 'latest'
else:
PREFIX = pymbar.version.short_version

if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
raise ImportError('The s3cmd pacakge is required. try $ pip install s3cmd')
# The secret key is available as a secure environment variable
# on travis-ci to push the build documentation to Amazon S3.
with tempfile.NamedTemporaryFile('w') as f:
f.write('''[default]
access_key = {AWS_ACCESS_KEY_ID}
secret_key = {AWS_SECRET_ACCESS_KEY}
'''.format(**os.environ))
f.flush()

template = ('s3cmd --guess-mime-type --config {config} '
'sync docs/_build/ s3://{bucket}/{prefix}/')
cmd = template.format(
config=f.name,
bucket=BUCKET_NAME,
prefix=PREFIX)
return_val = subprocess.call(cmd.split())

# Sync index file.
template = ('s3cmd --guess-mime-type --config {config} '
'sync devtools/ci/index.html s3://{bucket}/')
cmd = template.format(
config=f.name,
bucket=BUCKET_NAME)
return_val = subprocess.call(cmd.split())
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[nosetests]
verbosity=2
with-doctest=1

[metadata]
description-file = README.md

0 comments on commit a60ca61

Please sign in to comment.