Homebrew/homebrew — pull request #33988 by tdsmith (2014-11-07 07:06:30+00:00)
Title: Language::Python.setup_install

Add a setup_install method so that formula authors don't need to remember to pass --single-version-externally-managed to setuptools-based setup.py's.

There are two flavors of setup.py: setuptools-based and distutils-based; we need to pass different arguments to each. Importing setuptools monkey-patches distutils so that setuptools functions are always used, so that we're always working with a single flavor. Pip uses this same trick verbatim, internally.

An alternative is to vendor pip and use it to do our dirty work; Apple unfortunately doesn't ship pip so we can't rely on it already being installed.

setup_install takes a "python" argument so that it may also be used with python3.