Skip to content

Commit cb528c9

Browse files
authored
Merge pull request #516 from syseleven/feature/upgrade_pip_setuptools
Upgrade pip and setuptools on venv creation
2 parents 6325184 + 450b39e commit cb528c9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

manifests/pyvenv.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@
8181
mode => $mode,
8282
}
8383

84+
$pip_cmd = "${python::exec_prefix}${venv_dir}/bin/pip"
85+
8486
exec { "python_virtualenv_${venv_dir}":
85-
command => "${virtualenv_cmd} --clear ${system_pkgs_flag} ${venv_dir}",
87+
command => "${virtualenv_cmd} --clear ${system_pkgs_flag} ${venv_dir} && ${pip_cmd} --log ${venv_dir}/pip.log install --upgrade pip && ${pip_cmd} --log ${venv_dir}/pip.log install --upgrade setuptools",
8688
user => $owner,
8789
creates => "${venv_dir}/bin/activate",
8890
path => $_path,

spec/defines/pyvenv_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
context 'with default parameters' do
1818
it { is_expected.to contain_file('/opt/env') }
19-
it { is_expected.to contain_exec('python_virtualenv_/opt/env').with_command('pyvenv-3.5 --clear /opt/env') }
19+
it { is_expected.to contain_exec('python_virtualenv_/opt/env').with_command('pyvenv-3.5 --clear /opt/env && /opt/env/bin/pip --log /opt/env/pip.log install --upgrade pip && /opt/env/bin/pip --log /opt/env/pip.log install --upgrade setuptools') }
2020

2121
if %w[xenial bionic cosmic disco jessie stretch buster].include?(facts[:lsbdistcodename])
2222
it { is_expected.to contain_package('python3.5-venv').that_comes_before('File[/opt/env]') }

0 commit comments

Comments
 (0)