Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for latest versions of setuptools and pip #388

Merged
merged 1 commit into from
Apr 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions manifests/virtualenv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
# [*timeout*]
# The maximum time in seconds the "pip install" command should take. Default: 1800
#
# [*pip_args*]
# Arguments to pass to pip during initialization. Default: blank
#
# [*extra_pip_args*]
# Extra arguments to pass to pip after requirements file. Default: blank
#
Expand Down Expand Up @@ -84,6 +87,7 @@
$path = [ '/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin' ],
$cwd = undef,
$timeout = 1800,
$pip_args = '',
$extra_pip_args = '',
$virtualenv = undef
) {
Expand Down Expand Up @@ -156,10 +160,12 @@
}

$virtualenv_cmd = "${python::exec_prefix}${used_virtualenv}"
$pip_cmd = "${python::exec_prefix}${venv_dir}/bin/pip"

$pip_cmd = "${python::exec_prefix}${venv_dir}/bin/pip"
$pip_flags = "${pypi_index} ${proxy_flag} ${pip_args}"

exec { "python_virtualenv_${venv_dir}":
command => "true ${proxy_command} && ${virtualenv_cmd} ${system_pkgs_flag} -p ${python} ${venv_dir} && ${pip_cmd} wheel --help > /dev/null 2>&1 && { ${pip_cmd} wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { ${pip_cmd} --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} \$wheel_support_flag --upgrade pip ${distribute_pkg} || ${pip_cmd} --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} --upgrade pip ${distribute_pkg} ;}",
command => "true ${proxy_command} && ${virtualenv_cmd} ${system_pkgs_flag} -p ${python} ${venv_dir} && ${pip_cmd} --log ${venv_dir}/pip.log install ${pip_flags} --upgrade pip && ${pip_cmd} install ${pip_flags} --upgrade ${distribute_pkg}",
user => $owner,
creates => "${venv_dir}/bin/activate",
path => $path,
Expand All @@ -171,7 +177,7 @@

if $requirements {
exec { "python_requirements_initial_install_${requirements}_${venv_dir}":
command => "${pip_cmd} wheel --help > /dev/null 2>&1 && { ${pip_cmd} wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; ${pip_cmd} --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} \$wheel_support_flag -r ${requirements} ${extra_pip_args}",
command => "${pip_cmd} --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} --no-binary :all: -r ${requirements} ${extra_pip_args}",
refreshonly => true,
timeout => $timeout,
user => $owner,
Expand Down