Skip to content

Commit

Permalink
Add wheel and pip upgrade as a new gulp task
Browse files Browse the repository at this point in the history
Set it as the 1st one to the existent `installPythonLibs`
gulp task
  • Loading branch information
cpinamtz committed May 7, 2023
1 parent a0d3a39 commit e363566
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,23 @@ gulp.task('prePublishBundle', gulp.series('webpack', 'renameSourceMaps'));
gulp.task('checkDependencies', gulp.series('checkNativeDependencies'));
gulp.task('prePublishNonBundle', gulp.series('compile'));

gulp.task('preparePythonDeps', async () => {
let args = ['-m', 'pip', 'install', '-U', 'pip'];
await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true)
.then(() => true)
.catch((ex) => {
console.error("Failed to upgrade pip using 'python'", ex);
return false;
});
args = ['-m', 'pip', 'install', 'wheel'];
await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true)
.then(() => true)
.catch((ex) => {
console.error("Failed to install wheel requirement using 'python'", ex);
return false;
});
});

gulp.task('installPythonRequirements', async () => {
let args = [
'-m',
Expand Down Expand Up @@ -308,7 +325,7 @@ gulp.task('installDebugpy', async () => {
rmrf.sync('./pythonFiles/lib/temp');
});

gulp.task('installPythonLibs', gulp.series('installPythonRequirements', 'installDebugpy'));
gulp.task('installPythonLibs', gulp.series('preparePythonDeps', 'installPythonRequirements', 'installDebugpy'));

function spawnAsync(command, args, env, rejectOnStdErr = false) {
env = env || {};
Expand Down

0 comments on commit e363566

Please sign in to comment.