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 10
10
$python = $python_version ? {
11
11
' system' => ' python' ,
12
12
' pypy' => ' pypy' ,
13
- /\A(python)?([0-9](\.?[0-9])+)/ => " python${1 }" ,
13
+ /\A(python)?([0-9](\.?[0-9])+)/ => " python${2 }" ,
14
14
default => " python${python::version} " ,
15
15
}
16
16
74
74
}
75
75
}
76
76
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'
79
81
80
- Exec[' bootstrap pip' ] -> File [' pip-python' ] -> Package <| provider == pip |>
82
+ Exec[' bootstrap pip' ] -> File [' pip-python' ] -> Package <| provider == pip |>
81
83
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
+ }
90
100
}
91
101
}
92
102
' scl' : {
Original file line number Diff line number Diff line change 244
244
# Unfortunately this is the smartest way of getting the latest available package version with pip as of now
245
245
# Note: we DO need to repeat ourselves with "from version" in both grep and sed as on some systems pip returns
246
246
# 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" ,
248
248
' | grep -oP "\( from versions: .*\) " | sed -E "s/\( from versions: (.*?, )*(.*)\) /\2 /g"' ,
249
249
' | tr -d "[:space:]"' ])
250
250
Original file line number Diff line number Diff line change 61
61
62
62
describe 'with python::provider' do
63
63
context 'pip' do
64
- let ( :params ) { { provider : 'pip' } }
64
+ let ( :params ) { { pip : 'present' , provider : 'pip' } }
65
65
66
66
it {
67
67
is_expected . to contain_package ( 'virtualenv' ) . with (
384
384
385
385
describe 'with python::provider' do
386
386
context 'pip' do
387
- let ( :params ) { { provider : 'pip' } }
387
+ let ( :params ) { { pip : 'present' , provider : 'pip' } }
388
388
389
389
it {
390
390
is_expected . to contain_package ( 'virtualenv' ) . with (
You can’t perform that action at this time.
0 commit comments