@@ -21,6 +21,7 @@ import {
2121 PythonEnvironment ,
2222 PythonEnvironmentApi ,
2323} from '../../api' ;
24+ import { withProgress } from '../../common/window.apis' ;
2425import { CommandConstructorOptions } from '../base/commands/index' ;
2526import { updatePackagesAndNotify } from '../common/packageChanges' ;
2627import { createPipOrUvCommand } from './commands/factory' ;
@@ -100,7 +101,10 @@ export class PipPackageManager implements PackageManager, Disposable {
100101 UvUninstallCommand ,
101102 ) ;
102103 const packages = parsePackageSpecs ( toUninstall ) ;
103- await uninstallCmd . executeWithProgress ( { packages, showProgress : true } , 'Installing packages' ) ;
104+ await withProgress (
105+ { location : ProgressLocation . Notification , title : 'Installing packages' , cancellable : true } ,
106+ ( _progress , token ) => uninstallCmd . execute ( { packages, cancellationToken : token } ) ,
107+ ) ;
104108 }
105109
106110 // Execute install if needed
@@ -111,9 +115,10 @@ export class PipPackageManager implements PackageManager, Disposable {
111115 UvInstallCommand ,
112116 ) ;
113117 const packages = parsePackageSpecs ( toInstall ) ;
114- await installCmd . executeWithProgress (
115- { packages, upgrade : options . upgrade , showProgress : true } ,
116- 'Installing packages' ,
118+ await withProgress (
119+ { location : ProgressLocation . Notification , title : 'Installing packages' , cancellable : true } ,
120+ ( _progress , token ) =>
121+ installCmd . execute ( { packages, upgrade : options . upgrade , cancellationToken : token } ) ,
117122 ) ;
118123 }
119124
0 commit comments