mxcl/homebrew — pull request #18588 by samueljohn (2013-03-19 13:41:59+00:00)
Title: Python 2.x and 3.x

This is WIP. But progress is good so far. I want to open this PR this early to encourage comments. Expect --force pushed updates. Will rebase later.

### Introduction

To avoid having multiple formulae with endings `-py2` and `-py3`, handle support for different pythons (2.x vs. 3.x) and brewed vs. external via Requirements and `python do .. end` blocks. The requirements allow to choose which python version shall be ok and supports `:optional` and `:recommended`. The new `python do`

I really try to push this forward. I'll update the python formulae and all formulae using python in one go.

Tasks:

- [ ] `depends_on :python` Requirement
- [ ] `depends_on :python3` Requirement
- [ ] Write the correct sitecustomize.py also if the requirement is used.
- [ ] Improve sitecustomize.py so that multiple versions (and external) are better supported.
- [ ] Write the distutils.cfg if the requirement is used.
- [ ] Update Python formulae to reuse sitecustomize.py
- [ ] Allow formulae to use `setup.py --prefix=#{prefix}` instead of the complicated stuff as is.
- [ ] `pip` will install executable scripts to `HOMEBREW_PREFIX` (solves a few issues)
- [ ] Provide `python.standard_caveats`
- [ ] Add Python's pkg-config during build
- [ ] Use a temporary build environment to not touch stuff outside of the python block
- [ ] Provide `python.global_site_packages`
- [ ] Provide `python.binary` to indirect the call to python
- [ ] Replace `which_python` by `python.pythonxy`
- [ ] Provide `python do` block
- [ ] Provide `python2 do` block
- [ ] Provide `python.includes`
- [ ] Provide `python.libdir`
- [ ] Provide `python.version.major` and `python.version.minor`
- [ ] Provide `python.if3then3` which evaluates to "" for 2.x and to "3" for 3.x.
- [ ] Provide `python.framework` (is `nil` for non-framework builds)
- [ ] Provide `python.universal?`
- [ ] Provide `python.pypy?`
- [ ] Provide `python.brewed?`
- [ ] Provide `python.from_osx?`
- [ ] Write test_python.rb
- [ ] Check that the user has not `python -> python3` symlink, which is not recommended.
- [ ] Implement fallback so that old formulae can work even without `python do` blocks.
- [ ] Update audit to tell people to use the blocks and requirements
- [ ] sip
- [ ] vtk
- [ ] pyqt (for qt 4.x)
- [ ] mercurial
- [ ] enchant's python bindings
- [ ] pyside
- [ ] test :hg download strategy
- [ ] Do we want `brew create --python` ?