@@ -46,11 +46,23 @@ define([
46
46
'pandas' : { pipName : 'pandas' } ,
47
47
'matplotlib' : { pipName : 'matplotlib' } ,
48
48
'seaborn' : { pipName : 'seaborn' } ,
49
+ 'plotly' : { pipName : 'plotly' } ,
50
+ 'wordcloud' : { pipName : 'wordcloud' } ,
49
51
'sklearn' : { pipName : 'scikit-learn' } ,
52
+ 'scikit-posthocs' : { pipName : 'scikit-posthocs' } ,
50
53
'scipy' : { pipName : 'scipy' } ,
51
- 'statsmodel' : { pipName : 'statsmodel' } ,
52
- 'pinguin' : { pipName : 'pinguin' } ,
53
- 'wordcloud' : { pipName : 'wordcloud' } ,
54
+ 'statsmodels' : { pipName : 'statsmodels' } ,
55
+ 'factor-analyzer' : { pipName : 'factor-analyzer' } ,
56
+ 'pingouin' : { pipName : 'pingouin' } ,
57
+ 'category_encoders' : { pipName : 'category_encoders' } ,
58
+ 'imblearn' : { pipName : 'imblearn' } ,
59
+ 'xgboost' : { pipName : 'xgboost' } ,
60
+ 'lightgbm' : { pipName : 'lightgbm' } ,
61
+ 'catboost' : { pipName : 'catboost' } ,
62
+ 'auto-sklearn' : { pipName : 'auto-sklearn' } ,
63
+ 'tpot' : { pipName : 'tpot' } ,
64
+ 'PyMuPDF' : { pipName : 'PyMuPDF' } ,
65
+ 'sweetviz' : { pipName : 'sweetviz' } ,
54
66
}
55
67
}
56
68
@@ -135,6 +147,9 @@ define([
135
147
} else if ( menu === 'uninstall' ) {
136
148
var pipName = that . packageLib [ key ] . pipName ;
137
149
var code = com_util . formatString ( "!pip uninstall -y {0}" , pipName ) ;
150
+ if ( vpConfig . extensionType === 'lite' ) {
151
+ code = com_util . formatString ( "import piplite\npiplite.uninstall('{0}')" , pipName ) ;
152
+ }
138
153
// create block and run it
139
154
$ ( '#vp_wrapper' ) . trigger ( {
140
155
type : 'create_option_page' ,
@@ -146,6 +161,9 @@ define([
146
161
} else if ( menu === 'upgrade' ) {
147
162
var pipName = that . packageLib [ key ] . pipName ;
148
163
var code = com_util . formatString ( "!pip install --upgrade {0}" , pipName ) ;
164
+ if ( vpConfig . extensionType === 'lite' ) {
165
+ code = com_util . formatString ( "%pip install --upgrade {0}" , pipName ) ;
166
+ }
149
167
// create block and run it
150
168
$ ( '#vp_wrapper' ) . trigger ( {
151
169
type : 'create_option_page' ,
@@ -250,11 +268,17 @@ define([
250
268
let versionType = $ ( this . wrapSelector ( '.vp-inner-popup-body input[name="ver_select"]:checked' ) ) . val ( ) ;
251
269
var pipName = this . packageLib [ this . state . selected ] . pipName ;
252
270
var code = com_util . formatString ( "!pip install {0}" , pipName ) ;
271
+ if ( vpConfig . extensionType === 'lite' ) {
272
+ code = com_util . formatString ( "import piplite\npiplite.install('{0}')" , pipName ) ;
273
+ }
253
274
if ( versionType === 'specified' ) {
254
275
// specified version
255
276
let version = $ ( this . wrapSelector ( '.vp-inner-popup-version' ) ) . val ( ) ;
256
277
if ( version && version !== '' ) {
257
278
code = com_util . formatString ( "!pip install {0}=={1}" , pipName , version ) ;
279
+ if ( vpConfig . extensionType === 'lite' ) {
280
+ code = com_util . formatString ( "import piplite\npiplite.install('{0}=={1}')" , pipName , version ) ;
281
+ }
258
282
} else {
259
283
$ ( this . wrapSelector ( '.vp-inner-popup-version' ) ) . focus ( ) ;
260
284
return false ;
@@ -289,6 +313,15 @@ define([
289
313
...savedData . packageList
290
314
} ;
291
315
316
+ // load package list
317
+ that . loadPackageList ( ) ;
318
+ } ) . catch ( function ( err ) {
319
+ vpLog . display ( VP_LOG_TYPE . ERROR , err ) ;
320
+
321
+ that . packageLib = {
322
+ ...that . packageLibTemplate
323
+ } ;
324
+
292
325
// load package list
293
326
that . loadPackageList ( ) ;
294
327
} ) ;
@@ -314,12 +347,14 @@ define([
314
347
// install
315
348
item . appendFormatLine ( '<div class="{0} vp-icon-install" data-menu="{1}" title="{2}"></div>'
316
349
, 'vp-pm-item-menu-item' , 'install' , 'Install' ) ;
317
- // upgrade
318
- item . appendFormatLine ( '<div class="{0} vp-icon-upgrade {1}" data-menu="{2}" title="{3}"></div>'
319
- , 'vp-pm-item-menu-item' , ( info . installed === true ?'' :'disabled' ) , 'upgrade' , 'Upgrade' ) ;
320
- // uninstall
321
- item . appendFormatLine ( '<div class="{0} vp-icon-delete {1}" data-menu="{2}" title="{3}"></div>'
322
- , 'vp-pm-item-menu-item' , ( info . installed === true ?'' :'disabled' ) , 'uninstall' , 'Uninstall' ) ;
350
+ if ( vpConfig . extensionType !== 'lite' ) {
351
+ // upgrade
352
+ item . appendFormatLine ( '<div class="{0} vp-icon-upgrade {1}" data-menu="{2}" title="{3}"></div>'
353
+ , 'vp-pm-item-menu-item' , ( info . installed === true ?'' :'disabled' ) , 'upgrade' , 'Upgrade' ) ;
354
+ // uninstall
355
+ item . appendFormatLine ( '<div class="{0} vp-icon-delete {1}" data-menu="{2}" title="{3}"></div>'
356
+ , 'vp-pm-item-menu-item' , ( info . installed === true ?'' :'disabled' ) , 'uninstall' , 'Uninstall' ) ;
357
+ }
323
358
item . appendLine ( '</div>' ) ; // end of vp-pm-item-menu
324
359
item . appendLine ( '</div>' ) ; // end of vp-pm-item-header
325
360
// delete button
0 commit comments