|
159 | 159 | $pip_cmd = "${python::exec_prefix}${venv_dir}/bin/pip" |
160 | 160 |
|
161 | 161 | exec { "python_virtualenv_${venv_dir}": |
162 | | - 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} ;}", |
| 162 | + 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 || ${pip_cmd} --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} --upgrade pip ;}", |
163 | 163 | user => $owner, |
164 | 164 | creates => "${venv_dir}/bin/activate", |
165 | 165 | path => $path, |
|
169 | 169 | require => File[$venv_dir], |
170 | 170 | } |
171 | 171 |
|
| 172 | + exec { "python_distribute_${venv_dir}": |
| 173 | + 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 --upgrade ${distribute_pkg} || ${pip_cmd} --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} --upgrade ${distribute_pkg} ;}", |
| 174 | + user => $owner, |
| 175 | + cwd => $cwd, |
| 176 | + environment => $environment, |
| 177 | + path => $path, |
| 178 | + unless => "grep '^[\\t ]*VIRTUAL_ENV=[\\\\'\\\"]*${venv_dir}[\\\"\\\\'][\\t ]*$' ${venv_dir}/bin/activate", #Unless activate exists and VIRTUAL_ENV is correct we re-create the virtualenv |
| 179 | + require => Exec["python_virtualenv_${venv_dir}"], |
| 180 | + } |
| 181 | + |
172 | 182 | if $requirements { |
173 | 183 | exec { "python_requirements_initial_install_${requirements}_${venv_dir}": |
174 | 184 | 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}", |
175 | 185 | refreshonly => true, |
176 | 186 | timeout => $timeout, |
177 | 187 | user => $owner, |
178 | | - subscribe => Exec["python_virtualenv_${venv_dir}"], |
| 188 | + subscribe => Exec["python_distribute_${venv_dir}"], |
179 | 189 | environment => $environment, |
180 | 190 | cwd => $cwd |
181 | 191 | } |
|
0 commit comments