indoorsdog / development-machine

This is the machine I use to develop.
4 stars 2 forks source link

python, make as Vagrantfile-config-friendly as fnichol's rbenv cookbook allows #15

Closed lukewpatterson closed 9 years ago

lukewpatterson commented 12 years ago

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 the Vagrantfile is very nice, one can easily tell which rubies are installed, and which gems installed in those rubies

so copy that pattern for python config, copying-like-crazy code patterns seen in @fnichol's rbenv cookbok. nice touches like introspection-boomerang-json config

did I mention that is going to be an ordeal. but it will be worth it

lukewpatterson commented 12 years ago

the recipe name should be user_install

lukewpatterson commented 12 years ago

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'
            }
          ]
        }
      }
    ]
  }
lukewpatterson commented 12 years ago
lukewpatterson commented 12 years ago

actually, 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'
            }
          ]
        }
      }
    ]
  }
ecc11718 commented 12 years ago

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.

lukewpatterson commented 12 years ago

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...

ecc11718 commented 12 years ago

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.

lukewpatterson commented 12 years ago

i'm getting to close to fixing it. appending pythonbrew use and pythonbrew venv use commands. eta 15 minutes

ecc11718 commented 12 years ago

FIrst up-ping a box, everything works. But halting 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.

ecc11718 commented 12 years ago

Actually misspoke. Looks like a blocker on re-provision-ing.