Issue #7286 has been updated by Jason Antman.

jbouse (github.com/jbouse or Jeremy Bouse in watchers) and I are working on 
this, as we absolutely need it. I've looked at SMAC's branch, and 
https://github.com/jbouse/puppet/tree/feature/pip-multiple-venv/ is based off 
of that.

Hopefully we can get something suitable in a PR shortly. 

As to how to specify the virtualenv - it seems to me like this should be a 
parameter not a property, though I'm pretty new to type/provider development. 
'root' sounds like it would be logical, though I could also see just calling it 
"installroot" or "virtualenv". While this work will be python/pip specific, I 
assume the same property/parameter would also be suitable for npm (nodejs), 
rvm/gem, and any other system that supports the notion of installing packages 
into isolated environments.

The one other catch here, which is what seems to be missing from SMAC's PR, is 
that the environment needs to be part of the package "identity". The 
ini_setting provider in the puppetlabs-inifile forge module seems to handle 
this 
(https://github.com/puppetlabs/puppetlabs-inifile/commit/b0c8d5c34a0fd97d770bb8ce3c5927a9b52d188e)
 by turning the namevar into one based on multiple components.

(on a side note, I've been trying to think of a nice way of getting the pip 
provider to work with requirements files. I don't think one exists - the only 
pattern I can think of is having a pip_requirements type/provider, that parses 
the requirements file (on the node) and creates package resources (provider => 
pip) for each entry)

----------------------------------------
Feature #7286: Add virtualenv support to the pip package provider
https://projects.puppetlabs.com/issues/7286#change-100306

* Author: Jonathan Stoppani
* Status: Needs Decision
* Priority: Normal
* Assignee: Jason Antman
* Category: provider
* Target version: 
* Affected Puppet version: 
* Keywords: pip virtualenv python package
* Branch: https://github.com/SMAC/puppet/tree/feature/master/7286
----------------------------------------
Now that #6527 is merged into master, it is possible to easily add support for 
virtualenvs and fully complete #3572.

A `virtualenv` argument could be added to the `package` type in order to 
instrument `pip` to install the requested package into the given virtualenv 
directory.

For example:
     
     package { "my-python-package":
         ensure => latest,
         provider => pip,
         virtualenv => "/path/to/virtualenv
     }

The content of the virtualenv parameter will be passed directly to the 
`--environment` parameter of the `pip install` command

Some references:

* [http://pypi.python.org/pypi/pip](http://pypi.python.org/pypi/pip)
* 
[http://www.pip-installer.org/en/latest/index.html#using-pip-with-virtualenv](http://www.pip-installer.org/en/latest/index.html#using-pip-with-virtualenv)
* 
[https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/pip.rb](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/pip.rb)



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to