Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Travis #1397

Merged
merged 11 commits into from

8 participants

@SnippyHolloW

Travis is a continuous integration service that builds the project and check if tests pass. https://travis-ci.org/

This pull request contains:

  • the travis config (.travis.yml) file that tells what to install of the VM (before_install:); how to install (install:) the (python) requirements.txt and sklearn; and how to make tests (script:)
  • the pip-formated requirements of sklearn (requirements.txt)
  • the link to the build status image (README.rst), of course you need to change this link to https://secure.travis-ci.org/scikit-learn/scikit-learn.png once you will have merged.

To setup travis, you need one more thing than pulling this, as described here http://about.travis-ci.org/docs/user/getting-started/#Step-one%3A-Sign-in =>
go there https://travis-ci.org/ and sign-in with the scikit-learn github account (OAuth), give read and write permissions (for travis hooks on push), go to your profile https://travis-ci.org/profile and activate scikit-learn. Now you should have a continuously updated build status and a glimpse of it in the readme! :)

The full report is there https://travis-ci.org/SnippyHolloW/scikit-learn and so, once merged, there https://travis-ci.org/scikit-learn/scikit-learn

Cheers,
Keep up the good scikit-learn coming! :)

@amueller
Owner

Thanks, this is much appreciated! :+1:
Good travis integration would be really, really great!

cc @erg

@mblondel
Owner

Excellent. Seems like it's already working for this PR.

@ogrisel
Owner

Maybe there is a way to pass virtualenv --system-site-packages?

@SnippyHolloW

It should be the default.

@SnippyHolloW

Apparently, the virtualenv of Travis cannot use apt-get packages http://about.travis-ci.org/docs/user/languages/python/#Travis-CI-Uses-Isolated-virtualenvs I rolled back to installing scipy via pip.

@jaquesgrobler

This is very nice! I was actually gonna read up on this and attempt this myself! haha.. I'll put in some time to go through your work.. Thanks a lot and very cool :+1:

@ogrisel
Owner

Building a full scipy for each newly checked-in commit in each PR is wasting way too much CPU for nothing.

I think we should do the same hack as scikit-image:

https://github.com/scikit-image/scikit-image/blob/master/.travis.yml

@GaelVaroquaux
@dnouri

FWIW, you can also create a new virtualenv, one with --system-site-packages in Travis without problems:

before_install:
 - deactivate
 - virtualenv --system-site-packages ~/virtualenv/this
 - source ~/virtualenv/this/bin/activate

This way it'll have access to all packages installed via apt-get.

@GaelVaroquaux
@SnippyHolloW

Thanks @dnouri ! It works :+1:
Build+test time is now ~4min instead of ~10-13min. Reinstalling a full python stack (with the "erlang trick") should be longer I guess.

@GaelVaroquaux
@mblondel
Owner
README.rst
@@ -1,4 +1,5 @@
.. -*- mode: rst -*-
+.. image:: https://secure.travis-ci.org/SnippyHolloW/scikit-learn.png
@ogrisel Owner
ogrisel added a note

This will need to be updated to:

https://secure.travis-ci.org/scikit-learn/scikit-learn.png

at least I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@amueller
Owner

Looks great, +1 for merge.
Do we know which architecture / library versions are used? Can we have multiple ones?

.travis.yml
@@ -0,0 +1,13 @@
+language: python
+python:
+ - "2.7"
+before_install:
+ - deactivate
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq python-scipy python-nose
+ - virtualenv --system-site-packages ~/virtualenv/this
+ - source ~/virtualenv/this/bin/activate
+install:
+ - pip install -q -r requirements.txt --use-mirrors
@ogrisel Owner
ogrisel added a note

We no longer need the requirements as they are installed using apt, do we?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ogrisel
Owner

Indeed it would be great to have 32 bit arch.

@SnippyHolloW

Yes @ogrisel I put that the link to the travis build should be changed after the pull in the pull-request. Should I change it now before the pull? (it would break the image.) Also, yes we can remove the requirements, should I remove requirements.txt too? I think it's a good (because it's standard) to enforce them for others to install sklearn the pip way.

@amueller Travis-CI uses a 32bits Ubuntu 12.04 (server), the packages it uses are here http://packages.ubuntu.com/precise/

@ogrisel
Owner

Yes please change it now.

@GaelVaroquaux
@ogrisel
Owner

I think we are good to go for merging, thanks @SnippyHolloW .

@ogrisel
Owner

Any other comments before merging (I am +1)?

@mblondel
Owner

+1 for merge

@ogrisel ogrisel merged commit e256540 into scikit-learn:master
@ogrisel
Owner

Merged, thanks again @SnippyHolloW

@mblondel
Owner

Someone needs to configure Travis as @SnippyHolloW explained in the beginning but I don't know how to login with the scikit-learn organization.

@mblondel
Owner

I think I managed to activate it.

https://travis-ci.org/scikit-learn/scikit-learn

@ogrisel
Owner

Thanks, I was on the same page and was confused to see it turning on magically :)

@mblondel
Owner

I wonder if we can have Travis check a few recent PRs (hopefully not all 58 of them ;).

@ogrisel
Owner

All you need to do is merge master to them.

@amueller
Owner

Woot! thanks @SnippyHolloW !

@satra
Owner

thanks @SnippyHolloW - we were using the erlang trick for a different project - this makes it much nicer!

others: if you turn it on your own sklearn fork (via the Admin button), it will check a PR the moment you push a change to your branch corresponding to the PR.

@satra
Owner

you can also do it through: https://travis-ci.org/profile

@mblondel
Owner

Apparently the button https://secure.travis-ci.org/scikit-learn/scikit-learn.png indicates the status of the latest pull request... (currently failing)

@dnouri

Turns out there's an easier way of using a virtualenv with --system-site-packages, without the deactivate-create-source dance. Needs just this in .travis.yml:

virtualenv:
  system_site_packages: true

I've written a little blog post about this: http://danielnouri.org/notes/2012/11/23/use-apt-get-to-install-python-dependencies-for-travis-ci/

@mblondel
Owner

@dnouri: Can you send us a PR? Thanks a ton!

@ogrisel
Owner

@dnouri nice. Would you like to submit a PR?

@ogrisel
Owner

@mblondel just a few seconds away 2 days after the last comment :)

@SnippyHolloW
@mblondel
Owner

@mblondel just a few seconds away 2 days after the last comment :)

I laughed out loud in the lab :)

@ogrisel
Owner

@SnippyHolloW it's not faster but it's simpler / cleaner so +1 for a PR.

@SnippyHolloW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +11 −0 .travis.yml
  2. +1 −0  README.rst
View
11 .travis.yml
@@ -0,0 +1,11 @@
+language: python
+python:
+ - "2.7"
+before_install:
+ - deactivate
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq python-scipy python-nose
+ - virtualenv --system-site-packages ~/virtualenv/this
+ - source ~/virtualenv/this/bin/activate
+install: python setup.py build_ext --inplace
+script: make test
View
1  README.rst
@@ -1,4 +1,5 @@
.. -*- mode: rst -*-
+.. image:: https://secure.travis-ci.org/scikit-learn/scikit-learn.png
scikit-learn
============
Something went wrong with that request. Please try again.