From a2e66713c380c81a484583a3a33ff6dead87a496 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Wed, 9 Oct 2013 15:56:13 +0200 Subject: Add options install_args and uninstall_args. Modern pip does not install what it considers 'pre-release' versions unless '--pre' is given as argument. This change adds a mechanism for supplying the '--pre' argument or any other argument deemed necessary. --- manifests/pip.pp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'manifests/pip.pp') diff --git a/manifests/pip.pp b/manifests/pip.pp index ddbcd6f..1d576e0 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -35,12 +35,14 @@ # Fotis Gimian # define python::pip ( - $ensure = present, - $virtualenv = 'system', - $url = false, - $owner = 'root', - $proxy = false, - $environment = [] + $ensure = present, + $virtualenv = 'system', + $url = false, + $owner = 'root', + $proxy = false, + $environment = [], + $install_args = '', + $uninstall_args = '', ) { # Parameter validation @@ -80,7 +82,7 @@ define python::pip ( case $ensure { present: { exec { "pip_install_${name}": - command => "$pip_env --log-file ${cwd}/pip.log install ${proxy_flag} ${source}", + command => "$pip_env --log-file ${cwd}/pip.log install $install_args ${proxy_flag} ${source}", unless => "$pip_env freeze | grep -i -e ${grep_regex}", user => $owner, environment => $environment, @@ -89,7 +91,7 @@ define python::pip ( default: { exec { "pip_uninstall_${name}": - command => "echo y | $pip_env uninstall ${proxy_flag} ${name}", + command => "echo y | $pip_env uninstall $uninstall_args ${proxy_flag} ${name}", onlyif => "$pip_env freeze | grep -i -e ${grep_regex}", user => $owner, environment => $environment, -- cgit v1.2.3 From b84a20709beecc417893fdee4e25060ea63fab21 Mon Sep 17 00:00:00 2001 From: Vik Bhatti Date: Tue, 15 Oct 2013 13:38:38 +0100 Subject: Added support for setting egg name --- manifests/pip.pp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'manifests/pip.pp') diff --git a/manifests/pip.pp b/manifests/pip.pp index 1d576e0..8bd21d3 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -40,6 +40,7 @@ define python::pip ( $url = false, $owner = 'root', $proxy = false, + $egg = false, $environment = [], $install_args = '', $uninstall_args = '', @@ -74,9 +75,14 @@ define python::pip ( default => "^${name}==", } + $egg_name = $egg ? { + false => $name, + default => $egg + } + $source = $url ? { false => $name, - default => "${url}#egg=${name}", + default => "${url}#egg=${egg_name}", } case $ensure { -- cgit v1.2.3 From 65bf6fe8b6cf23050e755d62291f56f7e8654ede Mon Sep 17 00:00:00 2001 From: Sergey Stankevich Date: Sat, 19 Oct 2013 16:10:59 +0300 Subject: pip log option. Fixes #28 --- manifests/pip.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/pip.pp') diff --git a/manifests/pip.pp b/manifests/pip.pp index 8bd21d3..3ca33a8 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -88,7 +88,7 @@ define python::pip ( case $ensure { present: { exec { "pip_install_${name}": - command => "$pip_env --log-file ${cwd}/pip.log install $install_args ${proxy_flag} ${source}", + command => "$pip_env --log ${cwd}/pip.log install $install_args ${proxy_flag} ${source}", unless => "$pip_env freeze | grep -i -e ${grep_regex}", user => $owner, environment => $environment, -- cgit v1.2.3 From 8bf9aac814812d0235ee5aa08e097d6dd03c188d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Jagodzi=C5=84ski?= Date: Mon, 18 Nov 2013 08:27:57 +0100 Subject: Add to python::pip ensure => latest --- manifests/pip.pp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'manifests/pip.pp') diff --git a/manifests/pip.pp b/manifests/pip.pp index 3ca33a8..7b51439 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -95,6 +95,14 @@ define python::pip ( } } + latest: { + exec { "pip_install_${name}": + command => "$pip_env --log ${cwd}/pip.log install -U $install_args ${proxy_flag} ${source}", + user => $owner, + environment => $environment, + } + } + default: { exec { "pip_uninstall_${name}": command => "echo y | $pip_env uninstall $uninstall_args ${proxy_flag} ${name}", -- cgit v1.2.3