Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mdboom merged 4 commits intomatplotlib:masterfrommsabramo:testing_py3
Jun 27, 2012

Conversation

msabramo
Copy link
Contributor

This is a sort of continuation/enhancement of the work in#940.

Result oftox on Ubuntu 11.10 (I installed Python 3.1 from source because I didn't see anapt-get package for it):

GLOB test summary   py26: commands succeeded  py27: commands succeeded  py31: commands succeeded  py32: commands succeeded  congratulations :)

For Travis CI results, seehttp://travis-ci.org/#!/msabramo/matplotlib/builds/1607970 -- 2.6, 2.7, 3.1, and 3.2 are all passing!

@mdboom
Copy link
Member

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.

@pelson
Copy link
Member

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
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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 topip 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".

Copy link
Member

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.

Copy link
ContributorAuthor

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.

@msabramo
Copy link
ContributorAuthor

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 athttp://about.travis-ci.org/docs/user/getting-started/. IIRC, you can get around this by going to the repository in GitHub and going toAdmin | 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
Copy link
Member

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.

Copy link
ContributorAuthor

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

Copy link
Member

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?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Agreed. Seeccce78f.

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
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd certainlylike 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."

Copy link
ContributorAuthor

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 inf964e67.

@mdboom
Copy link
Member

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.

@mdboom
Copy link
Member

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 usepythonbrew <https://github.com/utahta/pythonbrew>_"

@msabramo
Copy link
ContributorAuthor

Is this merge-ready now?

- python setup.py install

script:
- mkdir ../foo
Copy link
Member

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?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

IIRC, thatfoo 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 by2to3. Will definitely take ideas for better folder names or a better approach.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sopwd 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 runpython setup.py build which will make a cleanbuild/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 totest_results (I don't have much feeling for a good folder name either).

@pelson
Copy link
Member

Whilst I haven't run this branch myself, the changes look sound, so it has my +1.

@mdboom
Copy link
Member

I'm going to go ahead and merge this. Thanks for this, I think it is very handy.

@msabramo
Copy link
ContributorAuthor

Looks like you haven't gotten around to merging this yet?

mdboom added a commit that referenced this pull requestJun 27, 2012
@mdboommdboom merged commit83471aa intomatplotlib:masterJun 27, 2012
@msabramo
Copy link
ContributorAuthor

@pelson
Copy link
Member

Don't think I have permissions to do this. I was looking for ahttps://github.com/matplotlib/matplotlib/admin/hooks as per the guide athttp://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?

@msabramo
Copy link
ContributorAuthor

Didhttp://travis-ci.org/#!/matplotlib/matplotlib ever get set up?

@pelson
Copy link
Member

@jdh2358: John, as I know you will have suitable permissions, please can you enable the travis hook on the matplotlib repository. Thanks!

@pelson
Copy link
Member

@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?

@mdboom
Copy link
Member

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. Nowtravis-ci.org seems to be non-responsive.

@efiring
Copy link
Member

On 2012/08/29 4:43 AM, Michael Droettboom wrote:

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
|travis-ci.org| seems to be non-responsive.


Reply to this email directly or view it on GitHub
#948 (comment).

It is building, but not successfully. Among other problems, it looks
like it is starting by trying to build numpy, and going through an
excruciatingly long process.

@msabramo
Copy link
ContributorAuthor

Numpy takes a long time to build -- should probably have it install a pre-built numpy withapt-get oreasy_install. Let me know if you need help.

@mdboom
Copy link
Member

Can apt-get run on the travis buildbot?easy_install on a Linux box installs Numpy from source anyway, so that provides no real savings. (I know next to nothing about Travis).

@msabramo
Copy link
ContributorAuthor

Yeah, there are definitely.travis.ymls that invokeapt-get and it's officially supported (try searchinghttp://about.travis-ci.org/docs/user/build-configuration/ for "apt-get"). The question is whether theapt-get repo has a new enough version of numpy to use matplotlib and test everything that you want to test. If not, I guess you might be able to find an alternative repo or create your own. Here's an example.travis.yml that usesapt-get to install numpy and also useseasy_install to install nibabel. (it also does this weird trick where it pretends to be an erlang project rather than python so that they can create a custom python environment by hand -- you may or may not need to go that far -- I forget the exact details of when it's needed):

https://github.com/matthew-brett/nipy/blob/master/.travis.yml

@pwuertz
Copy link
Contributor

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.

install:  - PY_VER=`python -c "import sys;print('%d.%d'%sys.version_info[:2])"`  - wget https://github.com/downloads/pwuertz/travis-tests/travis_py${PY_VER}_numpy.tar.gz  - sudo tar -C / -xf travis_py${PY_VER}_numpy.tar.gz

Setup and the travis testing results:
https://github.com/pwuertz/travis-tests
http://travis-ci.org/#!/pwuertz/travis-tests

@pelson
Copy link
Member

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 compatibletar.gz files (matplotlib also being one for use with upstream projects) which has a stable process for creating these tar files in the first place (via a.travis-ci.yml file perhaps).

@pwuertz
Copy link
Contributor

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.

@pwuertz
Copy link
Contributor

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@msabramo@mdboom@pelson@efiring@pwuertz@WeatherGod

[8]ページ先頭

©2009-2025 Movatter.jp