Closed lukewpatterson closed 9 years ago
the recipe name should be user_install
something like this
'virtualenv' => {
'git_ref' => 'the current tag/release/stable',
'user_installs' => [
{
'user' => 'vagrant',
'pythons' => [ '2.7.3' ],
'global' => '2.7.3',
'packages' => {
'2.7.3' => [
{
'name' => 'pygments',
'version' => '1.5'
}
]
}
}
]
}
python
s
chef
cookbook
for pythonbrew
pythonbrew
-installed python
s
chef
cookbook
for this, but it doesn't tie it back through pythonbrew's 'venv' command, so I'm not sure how that part will work out package
s into the virtualenv
-created environments
python
package we will want is: pygmentsactually, some tweaks:
'pythonbrew' => {
'user_installs' => [
{
'user' => 'vagrant',
'pythons' => [ '2.7.3' ],
'defaults' => {
'python' => '2.7.3',
'venv' => 'default'
},
'venv' => {
'default' => [
{
'name' => 'pygments',
'version' => '1.5'
}
]
}
}
]
}
Not sure if you noticed or it's a user-error but pygments
doesn't show up in the list of installed modules
$ pydoc modules
I noticed that another module I added to the installation list in the pythonbrew node didn't install either.
argh, forgot to add 'defaults' to the bash startup scripts
other note, I think the pip freeze
command might help more, when checking to see what is installed (yes, I know that command seems dumb, freeze
?) might as well be explode
or dither
working on it now...
Cool. I couldn't get pip freeze
to work (though there is an apt package for it and I bet a module). pydoc modules
works fine, as does
>>> help('modules')
from the REPL and seemed to give a simple indication that pygments
was missing.
i'm getting to close to fixing it. appending pythonbrew use
and pythonbrew venv use
commands. eta 15 minutes
FIrst up
-ping a box, everything works. But halt
ing and re-up
-ping yields this error:
[default] -- v-root: /vagrant
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mkdir -p Using `Python-2.7.3`
# Using `default` environment (found in /home/vagrant/.pythonbrew/venvs/Python-2.7.3)
# To leave an environment, simply run `deactivate`
/vagrant
~/git/repo/development-machine$
Don't think it's a breaker/blocker. Just FYI.
Actually misspoke. Looks like a blocker on re-provision
-ing.
this is going to be an ordeal
ok, so look here https://github.com/indoorsdog/development-machine/blob/a0a83b986bfa6c4a9bd976c7863b5377de55139c/Vagrantfile#L124
you see that
json
config in theVagrantfile
is very nice, one can easily tell whichrubies
are installed, and whichgems
installed in thoserubies
so copy that pattern for
python
config, copying-like-crazy code patterns seen in @fnichol's rbenv cookbok. nice touches like introspection-boomerang-json configdid I mention that is going to be an ordeal. but it will be worth it