Skip to content

Commit f77f8a2

Browse files
committed
Add wheel and pip upgrade as a new gulp task
Set it as the 1st one to the existent `installPythonLibs` gulp task
1 parent eb5d748 commit f77f8a2

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

gulpfile.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,23 @@ gulp.task('prePublishBundle', gulp.series('webpack', 'renameSourceMaps'));
226226
gulp.task('checkDependencies', gulp.series('checkNativeDependencies'));
227227
gulp.task('prePublishNonBundle', gulp.series('compile'));
228228

229+
gulp.task('preparePythonDeps', async () => {
230+
let args = ['-m', 'pip', 'install', '-U', 'pip'];
231+
await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true)
232+
.then(() => true)
233+
.catch((ex) => {
234+
console.error("Failed to upgrade pip using 'python'", ex);
235+
return false;
236+
});
237+
args = ['-m', 'pip', 'install', 'wheel'];
238+
await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true)
239+
.then(() => true)
240+
.catch((ex) => {
241+
console.error("Failed to install wheel requirement using 'python'", ex);
242+
return false;
243+
});
244+
});
245+
229246
gulp.task('installPythonRequirements', async () => {
230247
let args = [
231248
'-m',
@@ -308,7 +325,7 @@ gulp.task('installDebugpy', async () => {
308325
rmrf.sync('./pythonFiles/lib/temp');
309326
});
310327

311-
gulp.task('installPythonLibs', gulp.series('installPythonRequirements', 'installDebugpy'));
328+
gulp.task('installPythonLibs', gulp.series('preparePythonDeps', 'installPythonRequirements', 'installDebugpy'));
312329

313330
function spawnAsync(command, args, env, rejectOnStdErr = false) {
314331
env = env || {};

0 commit comments

Comments
 (0)