Skip to content

Commit 6f7560a

Browse files
authored
Merge pull request #223 from visualpython/release
Release v2.4.3 (HotFix)
2 parents b328ccd + 939c523 commit 6f7560a

19 files changed

+101
-33
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ jupyternotebook/visualpython
66
colab/visualpython
77
test/
88
.gitignore
9+
visualpython/js/com/com_Config.js

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#=============================================================================
1212
# Set version and replace it
1313
#=============================================================================
14-
VP_ORG_VER=2.4.0
15-
VP_NEW_VER=2.4.1
14+
VP_ORG_VER=2.4.2
15+
VP_NEW_VER=2.4.3
1616

1717
# update version info
1818
grep -REil "VP_ORG_VER=.+$" colab/build.colab.sh jupyterlab/build.jupyterlab.sh jupyternotebook/build.jupyternotebook.sh | xargs sed -i "s/VP_ORG_VER=.\+$/VP_ORG_VER=${VP_ORG_VER}/g"

colab/build.colab.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#=============================================================================
1212
# Replace Version
1313
#=============================================================================
14-
VP_ORG_VER=2.4.0
15-
VP_NEW_VER=2.4.1
14+
VP_ORG_VER=2.4.2
15+
VP_NEW_VER=2.4.3
1616

1717
# update version info
1818
# update manifest version with new numbering for new version

colab/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Visual Python for Colab",
33
"description": "GUI-based Python code generator for Google Colab as an extension",
4-
"version": "2.4.1",
4+
"version": "2.4.3",
55
"manifest_version": 3,
66
"icons": {
77
"48": "icon.png",

jupyterlab/.jupyterlite.doit.db

0 Bytes
Binary file not shown.

jupyterlab/build.jupyterlab.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#=============================================================================
1212
# Replace Version and Basic Files
1313
#=============================================================================
14-
VP_ORG_VER=2.4.0
15-
VP_NEW_VER=2.4.1
14+
VP_ORG_VER=2.4.2
15+
VP_NEW_VER=2.4.3
1616

1717
# update version info
1818
grep -REil "\"version\": \"${VP_ORG_VER}\"" package.json | xargs sed -i "s/\"version\": \"${VP_ORG_VER//\./\\.}\"/\"version\": \"${VP_NEW_VER}\"/g"

jupyterlab/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jupyterlab/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-visualpython",
3-
"version": "2.4.1",
3+
"version": "2.4.3",
44
"description": "GUI-based Python code generator for Jupyter Lab as an extension",
55
"keywords": [
66
"jupyter",

jupyterlab/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ classifiers = [
3232
"Programming Language :: Python :: 3.9",
3333
"Programming Language :: Python :: 3.10",
3434
]
35-
version = "2.4.1"
35+
version = "2.4.3"
3636

3737
[project.license]
3838
file = "LICENSE"
@@ -92,7 +92,7 @@ file = [
9292
]
9393

9494
[tool.tbump.version]
95-
current = "2.4.1"
95+
current = "2.4.3"
9696
regex = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)((?P<channel>a|b|rc|.dev)(?P<release>\\d+))?"
9797

9898
[tool.tbump.git]

jupyternotebook/build.jupyternotebook.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#=============================================================================
1212
# Replace Version and Basic Files
1313
#=============================================================================
14-
VP_ORG_VER=2.4.0
15-
VP_NEW_VER=2.4.1
14+
VP_ORG_VER=2.4.2
15+
VP_NEW_VER=2.4.3
1616

1717
# update version info
1818
grep -REil ${VP_ORG_VER//\./\\.} setup.py visualpython/js/com/com_Config.js visualpython/js/com/com_Const.js | xargs sed -i --follow-symlinks "s/${VP_ORG_VER//\./\\.}/${VP_NEW_VER}/g"

jupyternotebook/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name = name,
13-
version = '2.4.1',
13+
version = '2.4.3',
1414
packages = find_packages(),
1515
package_data = {"": ["*"], 'visualpython' : ['visualpython.yaml', 'README.md']},
1616
scripts = ['visualpython/bin/visualpy', 'visualpython/bin/visualpy.bat'],

visualpython/js/com/com_Config.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ define([
297297
* - automatically restart on jupyter kernel restart (loadVisualpython.js)
298298
*/
299299
readKernelFunction() {
300+
let that = this;
300301
// CHROME: change method to load py files ($.get -> require)
301302
return new Promise(function(resolve, reject) {
302303
var libraryList = [
@@ -315,7 +316,26 @@ define([
315316
libraryList.forEach(libCode => {
316317
promiseList.push(vpKernel.execute(libCode, true));
317318
});
318-
319+
320+
if (that.extensionType === 'lite') {
321+
let preInstallCode = '';
322+
let preInstallPackList = [
323+
'seaborn',
324+
'plotly',
325+
'scikit-learn',
326+
'scipy',
327+
'statsmodels'
328+
];
329+
preInstallPackList.forEach((packName, idx) => {
330+
preInstallCode += '%pip install ' + packName
331+
if (idx < preInstallPackList.length - 1) {
332+
preInstallCode += '\n';
333+
}
334+
});
335+
// pre-install packages
336+
promiseList.push(vpKernel.execute(preInstallCode, true));
337+
}
338+
319339
// run all promises
320340
let failed = false;
321341
Promise.all(promiseList).then(function(resultObj) {
@@ -883,7 +903,7 @@ define([
883903
'- Save VP Note before refreshing the page.'
884904
];
885905
com_interface.insertCell('markdown', info.join('\n'));
886-
com_interface.insertCell('code', "import piplite\npiplite.install('jupyterlab-visualpython==" + latestVersion + "')");
906+
com_interface.insertCell('code', "%pip install jupyterlab-visualpython==" + latestVersion);
887907
}
888908

889909
// update version_timestamp
@@ -956,7 +976,7 @@ define([
956976
/**
957977
* Version
958978
*/
959-
Config.version = "2.4.1";
979+
Config.version = "2.4.3";
960980

961981
/**
962982
* Type of mode

visualpython/js/com/com_Const.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ define ([
1919
class Constants { }
2020

2121
Constants.TOOLBAR_BTN_INFO = {
22-
HELP: "Visual Python 2.4.1"
22+
HELP: "Visual Python 2.4.3"
2323
, ICON: "vp-main-icon"
2424
, ID: "vpBtnToggle"
2525
, NAME: "toggle-vp"

visualpython/js/com/com_interface.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ define([
240240
}, 300);
241241
}
242242
}
243-
} else if (vpConfig.extensionType === 'lab') {
243+
} else if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') {
244244
if (notebookPanel && notebookPanel.sessionContext){
245245
var sessionContext = notebookPanel.sessionContext;
246246
let sessionType = sessionContext.type;

visualpython/js/com/component/PackageManager.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,28 @@ define([
6464
'PyMuPDF': { pipName: 'PyMuPDF' },
6565
'sweetviz': { pipName: 'sweetviz' },
6666
}
67+
68+
if (vpConfig.extensionType === 'lite') {
69+
this.packageLibTemplate = {
70+
'numpy': { pipName: 'numpy' },
71+
'pandas': { pipName: 'pandas' },
72+
'matplotlib': { pipName: 'matplotlib' },
73+
'seaborn': { pipName: 'seaborn' },
74+
'plotly': { pipName: 'plotly' },
75+
'sklearn': { pipName: 'scikit-learn' },
76+
'scikit-posthocs': { pipName: 'scikit-posthocs' },
77+
'scipy': { pipName: 'scipy' },
78+
'statsmodels': { pipName: 'statsmodels' },
79+
'factor-analyzer': { pipName: 'factor-analyzer' },
80+
'category_encoders': { pipName: 'category_encoders' },
81+
'imblearn': { pipName: 'imblearn' },
82+
'xgboost': { pipName: 'xgboost' },
83+
'lightgbm': { pipName: 'lightgbm' },
84+
'catboost': { pipName: 'catboost' },
85+
'auto-sklearn': { pipName: 'auto-sklearn' },
86+
'sweetviz': { pipName: 'sweetviz' },
87+
}
88+
}
6789
}
6890

6991
_bindEvent() {
@@ -148,7 +170,7 @@ define([
148170
var pipName = that.packageLib[key].pipName;
149171
var code = com_util.formatString("!pip uninstall -y {0}", pipName);
150172
if (vpConfig.extensionType === 'lite') {
151-
code = com_util.formatString("import piplite\npiplite.uninstall('{0}')", pipName);
173+
code = com_util.formatString("%pip uninstall {0}", pipName);
152174
}
153175
// create block and run it
154176
$('#vp_wrapper').trigger({
@@ -162,7 +184,7 @@ define([
162184
var pipName = that.packageLib[key].pipName;
163185
var code = com_util.formatString("!pip install --upgrade {0}", pipName);
164186
if (vpConfig.extensionType === 'lite') {
165-
code = com_util.formatString("%pip install --upgrade {0}", pipName);
187+
code = com_util.formatString("%pip install {0}", pipName);
166188
}
167189
// create block and run it
168190
$('#vp_wrapper').trigger({
@@ -269,15 +291,15 @@ define([
269291
var pipName = this.packageLib[this.state.selected].pipName;
270292
var code = com_util.formatString("!pip install {0}", pipName);
271293
if (vpConfig.extensionType === 'lite') {
272-
code = com_util.formatString("import piplite\npiplite.install('{0}')", pipName);
294+
code = com_util.formatString("%pip install {0}", pipName);
273295
}
274296
if (versionType === 'specified') {
275297
// specified version
276298
let version = $(this.wrapSelector('.vp-inner-popup-version')).val();
277299
if (version && version !== '') {
278300
code = com_util.formatString("!pip install {0}=={1}", pipName, version);
279301
if (vpConfig.extensionType === 'lite') {
280-
code = com_util.formatString("import piplite\npiplite.install('{0}=={1}')", pipName, version);
302+
code = com_util.formatString("%pip install {0}=={1}", pipName, version);
281303
}
282304
} else {
283305
$(this.wrapSelector('.vp-inner-popup-version')).focus();

visualpython/js/m_apps/Frame.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ define([
240240
that.setPreview(that.getCurrentCode());
241241
});
242242

243-
// menu on column (Deprecated on v2.3.6 - Temporarily Show on v.2.4.1)
243+
// menu on column (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3)
244244
$(document).on('contextmenu', this.wrapSelector('.' + VP_FE_TABLE + ' .' + VP_FE_TABLE_COLUMN), function(event) {
245245
event.preventDefault();
246246

@@ -270,7 +270,7 @@ define([
270270
that.showMenu(thisPos.left, thisPos.top + thisRect.height);
271271
});
272272

273-
// menu on row (Deprecated on v2.3.6 - Temporarily Show on v.2.4.1)
273+
// menu on row (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3)
274274
$(document).on('contextmenu', this.wrapSelector('.' + VP_FE_TABLE + ' .' + VP_FE_TABLE_ROW), function(event) {
275275
event.preventDefault();
276276
var idx = $(that.wrapSelector('.' + VP_FE_TABLE_ROW)).index(this); // 0 ~ n
@@ -595,7 +595,7 @@ define([
595595
that.loadCode(that.getTypeCode(FRAME_EDIT_TYPE.SHOW), true);
596596
});
597597

598-
// click toolbar item (Deprecated on v2.3.6 - Temporarily Show on v.2.4.1)
598+
// click toolbar item (Deprecated on v2.3.6 - Temporarily Show on v.2.4.3)
599599
$(document).on('click', this.wrapSelector('.vp-fe-toolbar-item'), function(evt) {
600600
evt.stopPropagation();
601601
var itemType = $(this).data('type');

visualpython/js/m_apps/PDF.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ define([
2121
'vp_base/js/com/component/FileNavigation'
2222
], function(pdfHtml, pdfCss, com_String, com_interface, PopupComponent, FileNavigation) {
2323

24-
const PDF_SHOW = '!pip show PyMuPDF nltk'
25-
const PDF_INSTALL1 = '!pip install PyMuPDF'
26-
const PDF_INSTALL2 = '!pip install nltk'
24+
var PDF_SHOW = '!pip show PyMuPDF nltk'
25+
var PDF_INSTALL1 = '!pip install PyMuPDF'
26+
var PDF_INSTALL2 = '!pip install nltk'
2727

2828
const PDF_IMPORT = `import pandas as pd
2929
import fitz
@@ -80,6 +80,12 @@ nltk.download('punkt')`;
8080
vp_pdfReturn: '',
8181
...this.state
8282
}
83+
84+
if (vpConfig.extensionType === 'lite') {
85+
PDF_SHOW = PDF_SHOW.replace('!', '%');
86+
PDF_INSTALL1 = PDF_INSTALL1.replace('!', '%');
87+
PDF_INSTALL2 = PDF_INSTALL2.replace('!', '%');
88+
}
8389
}
8490

8591
_bindEvent() {

visualpython/js/m_stats/Anova.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ define([
252252
}
253253

254254
if (tukey === true || scheffe === true || duncan === true) {
255-
codeList.push("!pip install scikit-posthocs");
255+
if (vpConfig.extensionType === 'lite') {
256+
codeList.push("%pip install scikit-posthocs");
257+
} else {
258+
codeList.push("!pip install scikit-posthocs");
259+
}
256260

257261
// Post hoc analysis - Tukey
258262
if (tukey === true) {
@@ -379,7 +383,11 @@ define([
379383
}
380384
if (tukey === true || scheffe === true || duncan === true) {
381385
// Add installation code
382-
codeList.push("!pip install scikit-posthocs");
386+
if (vpConfig.extensionType === 'lite') {
387+
codeList.push("%pip install scikit-posthocs");
388+
} else {
389+
codeList.push("!pip install scikit-posthocs");
390+
}
383391

384392
// Post hoc analysis - Tukey
385393
if (tukey === true) {
@@ -445,7 +453,11 @@ define([
445453
}
446454

447455
// Add installation code : # pip install pingouin
448-
codeList.push("!pip install pingouin");
456+
if (vpConfig.extensionType === 'lite') {
457+
codeList.push("%pip install pingouin");
458+
} else {
459+
codeList.push("!pip install pingouin");
460+
}
449461

450462
code.appendLine();
451463
code.appendLine();

visualpython/js/m_stats/FactorAnalysis.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ define([
167167
let codeList = [];
168168
let code = new com_String();
169169

170+
// Add installation code FIXME:
171+
if (vpConfig.extensionType === 'lite') {
172+
codeList.push('%pip install factor-analyzer');
173+
} else {
174+
codeList.push('!pip install factor-analyzer');
175+
}
176+
170177
// data declaration
171178
code.appendFormat("vp_df = {0}", data);
172179
if (this.columnSelector) {

0 commit comments

Comments
 (0)