menpo/menpo — pull request #421 by jabooth (2014-08-31 09:59:47+00:00)
Title: Travis CI now makes builds, Linux/OS X Python 2.7/3.4

This PR substantially improves our travis configuration so that every new commit onto menpo/master will yield an installable binary build of menpo for linux/osx python 2/3.

I've made a Python script called [traviconda](https://github.com/jabooth/traviconda) which does most of the heavy lifting of integrating Travis and conda. It is hosted separately, and so can be updated independently of the projects that rely on it (now menpo, cyassimp, cyrasterize, hdf5able). Each of our subprojects is already now working with traviconda - this PR just let's Menpo join in.

#### Traviconda
Traviconda works by:

1. Setting up either a Python 2.7 or Python 3.4 miniconda environment suitable for conda-build on the travis instance
2. Building the project using the locally hosted conda files at './conda'
3. Uploading the build to binstar, if and only if the build passes.

For menpo we have now moved the running of our unit tests into the test stage of the conda build. This means that builds are only made if all tests pass. Any failure of a test will mean the build fails (so nothing changes in terms of waiting for the tick of travis to let you know if a PR passes tests or not).

Builds are made for every branch of a traviconda project, so in the case of menpo that's just master (and the few other ones we have on here from time to time). Builds that are not 'releases' (i.e., any branch head which is not tagged with a version number) are placed on a channel at our binstar account with a name equal to the branch name. What this means is, to install the current master version of menpo, you can simply ask travis for the 'master' channel version:
```
conda install -c menpo/channel/master menpo
```
Or if you want to develop on the latest version of cyassimp:
```
conda install -c menpo/channel/master cyassimp
```
This is very useful for getting students set up with the latest version of menpo without having to go through the full setup of everything (if they just need the latest build but are going to do all their work in notebooks for example).

Git tagged releases are the same, but they are pushed out to the 'main' default channel. That means things work as is currently stated in the installation guide:
```
conda install -c menpo menpo
```
but the build itself is fully automated.

This has taken a while to set up, but it really simplifies things in the long run. For one thing it's easy to setup new traviconda builds, so if we do break menpo up a little more it won't be adding to the burden of worrying about releases or generating code that others can use - it should all just work.

#### Things to do

This PR is good to come in now, but we can take this a little further as we go to make things better:

1. **Re-add coveralls support** Currently this setup means we loose coveralls. It's completely possible to get it set back up, but I am a little sick of testing travis stuff so I say we come back to it later.
2. **Normalize tests so we start getting OS X builds** Currently OS X Python 2.7 builds fail due to the numerical differences in tests. We can probably resolve that with anaconda accelerate. Soon as the tests pass, we will start getting OS X Python 2.7 builds
3. **Menpo Python 3 support** This gives up a full test setup for Python 3. In fact, every build from here on out is attempted on Python 3 (OS X and Linux) but they are all failing due to Python 3 support not being complete. Now we can incrementally add Python 3 support (tracked in #419) and as soon as the tests pass, we will have Python 3 builds of menpo on OS X and Linux.
4. **Windows support**. @patricksnape has been working on getting appveyor setup for us, which is basically a windows equivalent to travis. It shouldn't be too hard to adapt traviconda to work with app veyor. At that stage we will be automatically generating builds for Python 2/3 OS X/Linux/Windows for all our code which will be amazing! :)