puppetlabs/puppet — pull request #2170 by jantman (2013-12-18 13:48:51+00:00)
Title: PUP-1062 pip support for virtualenvs

This adds a "virtualenv" parameter to the package type (see discussion in https://projects.puppetlabs.com/issues/7286) and, if that parameter is specified, uses bin/pip under that path instead of the system-wide one. This makes pip work for Python virtual environments (http://www.virtualenv.org).

This is really being submitted as a "early review" PR before I do any more work on it. At the moment it works when tested/confirmed manually, and all rspec tests pass. There are a few comments left in the code that need to be removed, and there are also some branches that still need to be tested.

But I'm looking for feedback on whether this would be considered for inclusion before I move forward. I'm prepared to take an alternate path of splitting this out to a custom type in a "virtualenv" module, but would for obvious reasons prefer to see this in core.

One other main piece that's missing is figuring out how to redefine/rewrite namevar as a composite of virtualenv and name, so the same package can be installed in multiple separate virtualenvs.