diff options
author | Sergey Stankevich <sergey.stankevich@gmail.com> | 2013-03-31 19:36:18 -0400 |
---|---|---|
committer | Sergey Stankevich <sergey.stankevich@gmail.com> | 2013-03-31 19:36:18 -0400 |
commit | b1aa3198c8d950b0e0f1254ffc28438a49540297 (patch) | |
tree | 5a7974effa2949741128d02e5f77c273fa371d05 | |
parent | 7abfab94312888cdbafd67a955677048e081a2c3 (diff) |
URL support for pip
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | manifests/pip.pp | 11 |
2 files changed, 12 insertions, 1 deletions
@@ -32,6 +32,8 @@ Installs and manages packages from pip. **virtualenv** — virtualenv to run pip in. +**url** — URL to install from. Default: none + **proxy** — Proxy server to use for outbound connections. Default: none python::pip { 'flask': diff --git a/manifests/pip.pp b/manifests/pip.pp index 9762c10..3a8ec1b 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -10,6 +10,9 @@ # [*virtualenv*] # virtualenv to run pip in. # +# [*url*] +# URL to install from. Default: none +# # [*proxy*] # Proxy server to use for outbound connections. Default: none # @@ -27,6 +30,7 @@ define python::pip ( $virtualenv, $ensure = present, + $url = false, $proxy = false ) { @@ -45,10 +49,15 @@ define python::pip ( default => "^${name}==", } + $source = $url ? { + false => $name, + default => "${url}#egg=${name}", + } + case $ensure { present: { exec { "pip_install_${name}": - command => "${virtualenv}/bin/pip install ${proxy_flag} ${name}", + command => "${virtualenv}/bin/pip install ${proxy_flag} ${source}", unless => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}", } } |