matplotlib/matplotlib — pull request #1454 by mdboom (2012-11-06 19:12:32+00:00)
Title: Retool the setup.py infrastructure

This is a complete reorganization of the `setup.py`/`setupext.py` infrastructure, and is the implementation of MEP11.

- setuptools is now used to integrate with pip/easy_install.
- Third-party Python dependencies (dateutil, pytz, six and pyparsing) are now installed automatically using setuptools, rather than maintaining local copies. This seems to work quite well for me, but will need to be tested in a number of environments (including with installers) to ensure it's a valid approach.
- The install is modular: it's possible to turn on/off installing the tests, sample_data and toolkits.
- We continue to ship Agg and PyCXX because they both require patches that haven't been merged upstream. However, the infrastructure is now present to make these optionally use the system libraries. That remains unimplemented, however, because doing so would produce a broken matplotlib.
- On Python 3.x, the latest release of pyparsing (1.5.6) has a bug that makes it completely non-functional. This has already been fixed in pyparsing's SVN [1]. The installer will warn when using a version that is too old, and importing matplotlib will raise an exception.

There was some discussion on the mailing list about making dateutil and pyparsing optional dependencies. However, on actually trying to implement that, I'm not sure that makes sense. pyplot imports a number of things directly from dateutil, and we would have to deprecate those things in the API. pyparsing is required merely to parse a font descriptor -- so you'd be losing pretty core functionality without it. I have instead made them hard requirements. The installer will warn if they aren't around, try to install them with pip/easy_install, and failing that importing matplotlib without those dependencies will raise an exception.

[1] http://pyparsing.svn.sourceforge.net/viewvc/pyparsing?view=revision&revision=219