Skip to content

Commit b1aa319

Browse files
author
Sergey Stankevich
committed
URL support for pip
1 parent 7abfab9 commit b1aa319

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Installs and manages packages from pip.
3232

3333
**virtualenv** — virtualenv to run pip in.
3434

35+
**url** — URL to install from. Default: none
36+
3537
**proxy** — Proxy server to use for outbound connections. Default: none
3638

3739
python::pip { 'flask':

manifests/pip.pp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
# [*virtualenv*]
1111
# virtualenv to run pip in.
1212
#
13+
# [*url*]
14+
# URL to install from. Default: none
15+
#
1316
# [*proxy*]
1417
# Proxy server to use for outbound connections. Default: none
1518
#
@@ -27,6 +30,7 @@
2730
define python::pip (
2831
$virtualenv,
2932
$ensure = present,
33+
$url = false,
3034
$proxy = false
3135
) {
3236

@@ -45,10 +49,15 @@
4549
default => "^${name}==",
4650
}
4751

52+
$source = $url ? {
53+
false => $name,
54+
default => "${url}#egg=${name}",
55+
}
56+
4857
case $ensure {
4958
present: {
5059
exec { "pip_install_${name}":
51-
command => "${virtualenv}/bin/pip install ${proxy_flag} ${name}",
60+
command => "${virtualenv}/bin/pip install ${proxy_flag} ${source}",
5261
unless => "${virtualenv}/bin/pip freeze | grep -i -e ${grep_regex}",
5362
}
5463
}

0 commit comments

Comments
 (0)