@@ -509,6 +509,72 @@ Let's say you've added a new module named
509509the list of default tests, append its name to ``default_test_modules ``
510510in :file: `lib/matplotlib/__init__.py `.
511511
512+ Using tox
513+ ---------
514+
515+ `Tox <http://tox.testrun.org/ >`_ is a tool for running tests against multiple
516+ Python environments, including multiple versions of Python (e.g.: 2.6, 2.7,
517+ 3.2, etc.) and even different Python implementations altogether (e.g.: CPython,
518+ PyPy, Jython, etc.)
519+
520+ Testing all 4 versions of Python (2.6, 2.7, 3.1, and 3.2) requires having four
521+ versions of Python installed on your system and on the PATH. Depending on your
522+ operating system, you may want to use your package manager (such as apt-get,
523+ yum or MacPorts) to do this, or use `pythonbrew
524+ <https://github.com/utahta/pythonbrew> `_.
525+
526+ tox makes it easy to determine if your working copy introduced any regressions
527+ before submitting a pull request. Here's how to use it:
528+
529+ .. code-block :: bash
530+
531+ $ pip install tox
532+ $ tox
533+
534+ You can also run tox on a subset of environments:
535+
536+ .. code-block :: bash
537+
538+ $ tox -e py26,py27
539+
540+ Tox processes everything serially so it can take a long time to test several
541+ environments. To speed it up, you might try using a new, parallelized version
542+ of tox called ``detox ``. Give this a try:
543+
544+ .. code-block :: bash
545+
546+ $ pip install -U -i http://pypi.testrun.org detox
547+ $ detox
548+
549+ Tox is configured using a file called ``tox.ini ``. You may need to edit this
550+ file if you want to add new environments to test (e.g.: ``py33 ``) or if you
551+ want to tweak the dependencies or the way the tests are run. For more info on
552+ the ``tox.ini `` file, see the `Tox Configuration Specification
553+ <http://tox.testrun.org/latest/config.html> `_.
554+
555+ Using Travis CI
556+ ---------------
557+
558+ `Travis CI <http://travis-ci.org/ >`_ is a hosted CI system "in the cloud".
559+
560+ Travis is configured to receive notifications of new commits to GitHub repos
561+ (via GitHub "service hooks") and to run builds or tests when it sees these new
562+ commits. It looks for a YAML file called ``.travis.yml `` in the root of the
563+ repository to see how to test the project.
564+
565+ Travis CI is already enabled for the `main matplotlib GitHub repository
566+ <https://github.com/matplotlib/matplotlib/> `_ -- for example, see `its Travis
567+ page <http://travis-ci.org/#!/matplotlib/matplotlib> `_.
568+
569+ If you want to enable Travis CI for your personal matplotlib GitHub repo,
570+ simply enable the repo to use Travis CI in either the Travis CI UI or the
571+ GitHub UI (Admin | Service Hooks). For details, see `the Travis CI Getting
572+ Started page <http://about.travis-ci.org/docs/user/getting-started/> `_.
573+
574+ Once this is configured, you can see the Travis CI results at
575+ http://travis-ci.org/#!/your_GitHub_user_name/matplotlib -- here's `an example
576+ <http://travis-ci.org/#!/msabramo/matplotlib> `_.
577+
512578.. _license-discussion :
513579
514580Licenses
0 commit comments