-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Testing python 2.6, 2.7, and 3.2 #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Great. Does this obsolete #940? One last thing I'd like to see before merging this is a short description in the developer documentation about a) how to run the tests with tox locally, b) how to get the results from Travis and c) the basics of how to participate in Travis, understanding that the last should be primarily a link to documentation elsewhere. |
Looks great. Any draw backs to the service? I definitely think we should give this a trial run on master. |
|
||
install: | ||
- pip install --use-mirrors nose numpy | ||
- if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip install --use-mirrors PIL; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines are my biggest concern. Presumably this is so that the CI server has the appropriate setup, but what happens is PIL & numpy already exist on the server?
Can you easily test with different versions of numpy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip install
doesn't reinstall packages without the --upgrade
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have enough exposure to pip
to have confidence, so thanks for the clarification.
Note: For clarification, I read what you said to mean "even if the original install wasn't done by pip, no re-installation will be done".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes -- that's my understanding of how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this is for Travis and Travis starts with a completely clean environment every time it runs. Basically you have a fresh new VirtualBox VM sandbox for each build.
IIRC, Travis CI doesn't support GitHub organizations for enabling repos in the Travis UI, so you might run into some trouble following their instructions at http://about.travis-ci.org/docs/user/getting-started/. IIRC, you can get around this by going to the repository in GitHub and going to Admin | Service Hooks, and manually pasting in a personal GitHub account and Travis CI token. |
|
||
Travis CI is already enabled for the main matplotlib GitHub repository: | ||
https://github.com/matplotlib/matplotlib/ -- for example, see: | ||
http://travis-ci.org/#!/matplotlib/matplotlib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These won't show up as links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do for me with Sphinx==1.1.3 and docutils==0.9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, must be a new feature. How about for consistency's sake with the rest of the documentation you provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. See ccce78f.
3.2, etc.) and even different Python implementations altogether (e.g.: CPython, | ||
PyPy, Jython, etc.) | ||
|
||
It's a good idea to run ``tox`` in your working directory before submitting a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this is good or not. How realistic is it to ask a first-time/infrequent contributor to run the tests over all python versions? Is such a statement going to put people off from contributing all together? Perhaps we could just encourage the use of TravisCI to do the version testing on behalf of the user to keep their lives as simple as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd certainly like to make this recommendation, but I think agree with @pelson, that it might be discouraging for simple submissions. How about we just say something like "tox makes it easy to determine if your working copy introduced any regressions before submitting a pull request."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I used this wording in f964e67.
This documentation looks great. Just ran your instructions for running tox in a clean virtualenv and all works great. I think this is going to be very handy. I'll wait 24 hours to see if there's further comments, and barring that, I think this should be merged and have the service hook set up. |
One thing that would be nice to add to the documentation about tox. "Testing all 4 versions of Python (2.6, 2.7, 3.1, and 3.2) requires having four versions of Python installed on your system and on the PATH. Depending on your operating system, you may want to use your package manager (such as apt-get, yum or MacPorts) to do this, or use |
Is this merge-ready now? |
- python setup.py install | ||
|
||
script: | ||
- mkdir ../foo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if we could have a better folder name. Presumably this is done to have somewhere to store the result images?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, that foo
folder is simply so that we're not in the source directory because then Python 3 will import modules from there which have not been transformed by 2to3
. Will definitely take ideas for better folder names or a better approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So pwd
is the root of the repository, but if your in the root of the repository, when importing matplotlib via python3, you would actually be importing the source rather than the built version?
Perhaps it would be better to run python setup.py build
which will make a clean build/lib*
directory, or is it advised by travis to actually install the code that is being tested?
At the very least, this mkdir should have a comment to explain the reasoning, and perhaps rename the folder to test_results
(I don't have much feeling for a good folder name either).
Whilst I haven't run this branch myself, the changes look sound, so it has my +1. |
I'm going to go ahead and merge this. Thanks for this, I think it is very handy. |
Looks like you haven't gotten around to merging this yet? |
Testing python 2.6, 2.7, and 3.2
Did you enable http://travis-ci.org/#!/matplotlib/matplotlib ? |
Don't think I have permissions to do this. I was looking for a https://github.com/matplotlib/matplotlib/admin/hooks as per the guide at http://about.travis-ci.org/docs/user/how-to-setup-and-trigger-the-hook-manually/. @mdboom: do you have admin privs for the mpl repo or organization? |
Did http://travis-ci.org/#!/matplotlib/matplotlib ever get set up? |
@jdh2358: John, as I know you will have suitable permissions, please can you enable the travis hook on the matplotlib repository. Thanks! |
@mdboom: We still need to set this up (it would have caught the tests failing). Are there other people with admin rights other than yourself? |
I'm looking into this now. I have the service hook set up, and I have flipped the switch on the matplotlib/matplotlib repo on Travis, but I'm still not having much luck getting the build to trigger. Now |
On 2012/08/29 4:43 AM, Michael Droettboom wrote:
It is building, but not successfully. Among other problems, it looks |
Numpy takes a long time to build -- should probably have it install a pre-built numpy with |
Can apt-get run on the travis buildbot? |
Yeah, there are definitely https://github.com/matthew-brett/nipy/blob/master/.travis.yml |
I found a way to bypass the numpy compilation process. I set up a travis worker box and built binary dists of numpy for our testing environments (2.6, 2.7, 3.1, 3.2). The install section of travis.yml can now download and unzip numpy instead of compiling it.
Setup and the travis testing results: |
Its a nice solution, but it sounds a bit flakey. I'm assuming we can't just use a pre-built versions of numpy from official sources? This is bound to be a common problem for other projects depending on numpy. Maybe its worth spinning up a whole repo which has pre-built travis compatible |
No, there are no pre-built versions for linux. I think ideally one would just use a travis worker to build all dependencies required for testing matplotlib, build binary dists taylored to the travis environment and upload these somewhere. Travis announced support for building artifacts which could aid this process, but right now there is no official way of getting data out of the worker processes. |
Ok, I just talked to the guys in the irc chat. There is currently no way of securely uploading data from a worker process. So setting up a VM like I did for doing the work is apparently the only way at the moment. |
This is a sort of continuation/enhancement of the work in #940.
Result of
tox
on Ubuntu 11.10 (I installed Python 3.1 from source because I didn't see anapt-get
package for it):For Travis CI results, see http://travis-ci.org/#!/msabramo/matplotlib/builds/1607970 -- 2.6, 2.7, 3.1, and 3.2 are all passing!