poise / python

THIS COOKBOOK IS DEPRECATED – Chef cookbook to install Python and related tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Packages specified as URLs break version_check_cmd in python_pip Resource

ampledata opened this issue · comments

Per https://github.com/poise/python/blob/master/providers/pip.rb#L111:

version_check_cmd = "#{which_pip(new_resource)} freeze | grep -i '^#{new_resource.package_name}=='"

Given a package_name of git+ssh://git@github.com/ampledata/kiss.git@master#egg=kiss:

url = 'git+ssh://git@github.com/ampledata/kiss.git@master#egg=kiss'
python_pip url do
  action :install
end

...version_check_cmd will always fail to match.

Here's the output from pip install and pip freeze on the command line:

$ pip install git+ssh://git@github.com/ampledata/kiss.git@master#egg=kiss 
$ pip freeze|grep kiss
kiss==1.0.1

I've not implemented a work-around yet, but one idea is groking the package name from the URL and using that to match pip freeze's output.

Tested using python Cookbook 1.4.6 and pip 1.5.2 w/ Python 2.7

This is better supported in https://github.com/poise/poise-python via the python_requirements resource or python_execute %w{-m pip install git+ssh://...} if you want to do it inline.