Skip to content

Commit

Permalink
[COOK-2297] more gracefully handle pip packages from VCS or source ar…
Browse files Browse the repository at this point in the history
…chives
  • Loading branch information
Frick committed Jan 30, 2013
1 parent 34cb929 commit 3663fd7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion providers/pip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ def candidate_version
end

def install_package(version)
pip_cmd('install', version == 'latest' ? '' : "==#{version}")
# if a version isn't specified (latest), is a source archive (ex. http://my.package.repo/SomePackage-1.0.4.zip),
# or from a VCS (ex. git+https://git.repo/some_pkg.git) then do not append a version as this will break the source link
if version == 'latest' || @new_resource.name.downcase.start_with?('http:') || ['git', 'hg', 'svn'].include?(@new_resource.name.downcase.split('+')[0])
version = ''
else
version = "==#{version}"
end
pip_cmd('install', version)
end

def upgrade_package(version)
Expand Down

0 comments on commit 3663fd7

Please sign in to comment.