Skip to content

Commit e5e3f97

Browse files
committed
PUPINF-506: Add very basic Windows support to requirements.pp
1 parent 5880aec commit e5e3f97

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

manifests/requirements.pp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
$environment = [],
7474
$forceupdate = false,
7575
$cwd = undef,
76+
$pip_env = undef,
7677
$extra_pip_args = '',
7778
$manage_requirements = true,
7879
$fix_requirements_owner = true,
@@ -99,9 +100,12 @@
99100
default => $virtualenv,
100101
}
101102

102-
$pip_env = $virtualenv ? {
103-
'system' => "${::python::exec_prefix} pip",
104-
default => "${::python::exec_prefix} ${virtualenv}/bin/pip",
103+
$pip_env_ = $pip_env ? {
104+
undef => $virtualenv ? {
105+
'system' => "${::python::exec_prefix} pip",
106+
default => "${::python::exec_prefix} ${virtualenv}/bin/pip",
107+
},
108+
default => $pip_env,
105109
}
106110

107111
$proxy_flag = $proxy ? {
@@ -129,13 +133,19 @@
129133
}
130134

131135
exec { "python_requirements${name}":
132-
provider => shell,
133-
command => "${pip_env} --log ${log}/pip.log install ${proxy_flag} ${src_flag} -r ${requirements} ${extra_pip_args}",
136+
#provider => shell,
137+
command => "${pip_env_} --log ${log}/pip.log install ${proxy_flag} ${src_flag} -r ${requirements} ${extra_pip_args}",
134138
refreshonly => !$forceupdate,
135139
timeout => $timeout,
136140
cwd => $cwd,
137-
user => $owner,
138141
subscribe => File[$requirements],
139142
environment => $environment,
140143
}
144+
145+
if $::operatingsystem != 'windows' {
146+
Exec["python_requirements${name}"] {
147+
user => $owner,
148+
}
149+
}
150+
141151
}

manifests/virtualenv.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@
217217
group => $group,
218218
cwd => $cwd,
219219
require => Exec["python_virtualenv_${venv_dir}"],
220+
pip_env => $pip_cmd,
220221
extra_pip_args => $extra_pip_args,
221222
}
222223
}

0 commit comments

Comments
 (0)