File tree Expand file tree Collapse file tree 3 files changed +25
-15
lines changed Expand file tree Collapse file tree 3 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 1010 $python = $python_version ? {
1111 ' system' => ' python' ,
1212 ' pypy' => ' pypy' ,
13- /\A(python)?([0-9](\.?[0-9])+)/ => " python${1 }" ,
13+ /\A(python)?([0-9](\.?[0-9])+)/ => " python${2 }" ,
1414 default => " python${python::version} " ,
1515 }
1616
7474 }
7575 }
7676
77- # Install pip without pip, see https://pip.pypa.io/en/stable/installing/.
78- include 'python::pip::bootstrap'
77+ # Respect the $pip_ensure setting
78+ unless $pip_ensure == ' absent' {
79+ # Install pip without pip, see https://pip.pypa.io/en/stable/installing/.
80+ include 'python::pip::bootstrap'
7981
80- Exec[' bootstrap pip' ] -> File [' pip-python' ] -> Package <| provider == pip |>
82+ Exec[' bootstrap pip' ] -> File [' pip-python' ] -> Package <| provider == pip |>
8183
82- Package <| title == ' pip' |> {
83- name => ' pip' ,
84- provider => ' pip' ,
85- }
86- Package <| title == ' virtualenv' |> {
87- name => ' virtualenv' ,
88- provider => ' pip' ,
89- require => Package[$pythondev ],
84+ Package <| title == ' pip' |> {
85+ name => ' pip' ,
86+ provider => ' pip' ,
87+ }
88+ if $pythondev {
89+ Package <| title == ' virtualenv' |> {
90+ name => ' virtualenv' ,
91+ provider => ' pip' ,
92+ require => Package[' python-dev' ],
93+ }
94+ } else {
95+ Package <| title == ' virtualenv' |> {
96+ name => ' virtualenv' ,
97+ provider => ' pip' ,
98+ }
99+ }
90100 }
91101 }
92102 ' scl' : {
Original file line number Diff line number Diff line change 244244 # Unfortunately this is the smartest way of getting the latest available package version with pip as of now
245245 # Note: we DO need to repeat ourselves with "from version" in both grep and sed as on some systems pip returns
246246 # more than one line with paretheses.
247- $latest_version = join([" ${pip_env} install ${proxy_flag} ${pkgname} ==notreallyaversion 2>&1" ,
247+ $latest_version = join([" ${pip_install} ${pypi_index} ${proxy_flag} ${install_args} ${install_editable } ${pkgname} ==notreallyaversion 2>&1" ,
248248 ' | grep -oP "\( from versions: .*\) " | sed -E "s/\( from versions: (.*?, )*(.*)\) /\2 /g"' ,
249249 ' | tr -d "[:space:]"' ])
250250
Original file line number Diff line number Diff line change 6161
6262 describe 'with python::provider' do
6363 context 'pip' do
64- let ( :params ) { { provider : 'pip' } }
64+ let ( :params ) { { pip : 'present' , provider : 'pip' } }
6565
6666 it {
6767 is_expected . to contain_package ( 'virtualenv' ) . with (
384384
385385 describe 'with python::provider' do
386386 context 'pip' do
387- let ( :params ) { { provider : 'pip' } }
387+ let ( :params ) { { pip : 'present' , provider : 'pip' } }
388388
389389 it {
390390 is_expected . to contain_package ( 'virtualenv' ) . with (
You can’t perform that action at this time.
0 commit comments