Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Travis #1397

Merged
merged 11 commits into from

8 participants

syhw Andreas Mueller Mathieu Blondel Olivier Grisel Jaques Grobler Gael Varoquaux Daniel Nouri Satrajit Ghosh
syhw

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! :)

Andreas Mueller
Owner

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

cc @erg

Mathieu Blondel
Owner

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

Olivier Grisel
Owner

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

syhw

It should be the default.

syhw

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.

Jaques Grobler

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:

Olivier Grisel
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

Gael Varoquaux
Daniel Nouri

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.

Gael Varoquaux
syhw

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.

Gael Varoquaux
Mathieu Blondel
Owner
README.rst
@@ -1,4 +1,5 @@
.. -*- mode: rst -*-
+.. image:: https://secure.travis-ci.org/SnippyHolloW/scikit-learn.png
Olivier Grisel 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
Andreas Mueller
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
Olivier Grisel 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
Olivier Grisel
Owner

Indeed it would be great to have 32 bit arch.

syhw

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/

Olivier Grisel
Owner

Yes please change it now.

Gael Varoquaux
Olivier Grisel
Owner

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

Olivier Grisel
Owner

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

Mathieu Blondel
Owner

+1 for merge

Olivier Grisel ogrisel merged commit e256540 into from
Olivier Grisel
Owner

Merged, thanks again @SnippyHolloW

Mathieu Blondel
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.

Mathieu Blondel
Owner

I think I managed to activate it.

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

Olivier Grisel
Owner

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

Mathieu Blondel
Owner

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

Olivier Grisel
Owner

All you need to do is merge master to them.

Andreas Mueller
Owner

Woot! thanks @SnippyHolloW !

Satrajit Ghosh
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.

Satrajit Ghosh
Owner

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

Mathieu Blondel
Owner

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

Daniel Nouri

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/

Mathieu Blondel
Owner

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

Olivier Grisel
Owner

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

Olivier Grisel
Owner

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

syhw
Mathieu Blondel
Owner

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

I laughed out loud in the lab :)

Olivier Grisel
Owner

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

syhw
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
11 .travis.yml
View
@@ -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
1  README.rst
View
@@ -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.