Skip to content

Commit 4b1805f

Browse files
committed
Update for jlab 3
1 parent 0e4a4cd commit 4b1805f

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

{{cookiecutter.github_project_name}}/package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@
3030
},
3131
"scripts": {
3232
"build": "npm run build:lib && npm run build:nbextension",
33-
"build:labextension": "npm run clean:labextension && mkdirp {{ cookiecutter.python_package_name }}/labextension && cd {{ cookiecutter.python_package_name }}/labextension && npm pack ../..",
33+
"build:labextension": "jupyter labextension build .",
34+
"build:labextension:dev": "jupyter labextension build --development True .",
3435
"build:lib": "tsc",
3536
"build:nbextension": "webpack -p",
3637
"build:all": "npm run build:labextension && npm run build:nbextension",
3738
"clean": "npm run clean:lib && npm run clean:nbextension",
3839
"clean:lib": "rimraf lib",
39-
"clean:labextension": "rimraf {{ cookiecutter.python_package_name }}/labextension",
40+
"clean:labextension": "rimraf {{ cookiecutter.python_package_name }}/jupyterlab_widgets/lab3extension",
4041
"clean:nbextension": "rimraf {{ cookiecutter.python_package_name }}/nbextension/static/index.js",
4142
"lint": "eslint . --ext .ts,.tsx --fix",
4243
"lint:check": "eslint . --ext .ts,.tsx",
@@ -51,7 +52,7 @@
5152
"watch:nbextension": "webpack --watch"
5253
},
5354
"dependencies": {
54-
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3"
55+
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3 || ^4.0.0-beta.1"
5556
},
5657
"devDependencies": {
5758
"@phosphor/application": "^1.6.0",
@@ -90,6 +91,13 @@
9091
"webpack-cli": "^3.1.2"
9192
},
9293
"jupyterlab": {
93-
"extension": "lib/plugin"
94+
"extension": "lib/plugin",
95+
"outputDir": "jupyterlab_widgets/static",
96+
"sharedPackages": {
97+
"@jupyter-widgets/base": {
98+
"bundled": false,
99+
"singleton": true
100+
}
101+
}
94102
}
95103
}

{{cookiecutter.github_project_name}}/setup.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@
2222
name = '{{ cookiecutter.python_package_name }}'
2323

2424
# Ensure a valid python version
25-
ensure_python('>=3.4')
25+
ensure_python('>=3.6')
2626

2727
# Get our version
2828
version = get_version(pjoin(name, '_version.py'))
2929

3030
nb_path = pjoin(HERE, name, 'nbextension', 'static')
31-
lab_path = pjoin(HERE, name, 'labextension')
31+
# lab_path = pjoin(HERE, name, 'labextension')
32+
lab3_path = pjoin(HERE, name, 'lab3extension')
3233

3334
# Representative files that should exist after a successful build
3435
jstargets = [
@@ -39,14 +40,18 @@
3940
package_data_spec = {
4041
name: [
4142
'nbextension/static/*.*js*',
42-
'labextension/*.tgz'
43+
# 'labextension/*.tgz',
44+
'lab3extension/*'
4345
]
4446
}
4547

48+
labext_name = "{{ cookiecutter.npm_package_name }}"
49+
4650
data_files_spec = [
4751
('share/jupyter/nbextensions/{{ cookiecutter.python_package_name}}',
4852
nb_path, '*.js*'),
49-
('share/jupyter/lab/extensions', lab_path, '*.tgz'),
53+
("share/jupyter/labextensions/%s" % labext_name, lab3_path, "*.*"),
54+
# ('share/jupyter/lab/extensions', lab_path, '*.tgz'),
5055
('etc/jupyter/nbconfig/notebook.d' , HERE, '{{ cookiecutter.python_package_name}}.json')
5156
]
5257

@@ -85,6 +90,7 @@
8590
'Framework :: Jupyter',
8691
],
8792
include_package_data = True,
93+
python_requires=">=3.6",
8894
install_requires = [
8995
'ipywidgets>=7.0.0',
9096
],

0 commit comments

Comments
 (0)