-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for JupyterLab 3 #83
Conversation
Since lab 2 will normally be able to just pull it from npm, I don't think we need to generate lab2 bundles for dist. |
That would certainly be easier. I was thinking people wouldn't want to give up our current pip-installable solution. We could certainly generate bundles for lab 2 and lab 3. The question would be if lab 2 and lab 3 would ignore the wrong one. Lab 2 would certainly ignore lab 3 bundles since they are in a new place. So would lab 3 ignore the lab 2 bundle, recognizing it was not compatible? |
If the old compatibility checking code is there it should, but it might get confused by having two things installed with the same name. Also, it might end up downloading the lab3 version from npm due to the lab2 version being installed. ? |
@@ -29,12 +29,12 @@ | |||
"url": "https://github.com/{{ cookiecutter.github_organization_name }}/{{ cookiecutter.github_project_name }}" | |||
}, | |||
"scripts": { | |||
"build": "npm run build:lib && npm run build:nbextension", | |||
"build:labextension": "npm run clean:labextension && mkdirp {{ cookiecutter.python_package_name }}/labextension && cd {{ cookiecutter.python_package_name }}/labextension && npm pack ../..", | |||
"build": "npm run build:lib && npm run build:nbextension && npm run build:labextension", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it actually a good idea to change this line? I personally develop mostly in Jupyter Notebook, and having npm run build
trigger a jupyter labextension build .
is not very friendly with this workflow, it will simply fail in envs where JupyterLab is not installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is it actually supposed to work with JupyterLab 2? It seems to fail with Please supply at least one subcommand: check, disable, enable, install, link, list, uninstall, unlink, update
"build:labextension": "npm run clean:labextension && mkdirp {{ cookiecutter.python_package_name }}/labextension && cd {{ cookiecutter.python_package_name }}/labextension && npm pack ../..", | ||
"build": "npm run build:lib && npm run build:nbextension && npm run build:labextension", | ||
"build:labextension": "jupyter labextension build .", | ||
"build:labextension:dev": "jupyter labextension build --development True .", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to make the build
command default to --development
, similar to jupyterlab/extension-cookiecutter-ts#98
If anyone here wants to take over this PR to push it over the finish line soon, feel free to do so. I'll circle back to it at the beginning of the year if it is still open. |
Hi, what more needs to happen here? |
data_files_spec = [ | ||
('share/jupyter/nbextensions/{{ cookiecutter.python_package_name}}', | ||
nb_path, '*.js*'), | ||
('share/jupyter/lab/extensions', lab_path, '*.tgz'), | ||
("share/jupyter/labextensions/%s" % labext_name, lab3_path, "*.*"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the JupyterLab extension cookiecutter:
("share/jupyter/labextensions/%s" % labext_name, lab3_path, "*.*"), | |
("share/jupyter/labextensions/%s" % labext_name, lab3_path, "**"), |
@ianhi maybe we'll want to port some of the recent changes from https://github.com/jupyterlab/extension-cookiecutter-ts so they can also be used here? (for example adding the Maybe something to put on the plate for next week if a couple of people are going to sprint on ipywidgets? |
Hi, I'm hoping to push this to completion over the weekend. @jasongrout is it ok to push directly to this branch, or should I open a new PR building on it? |
Nevermind, things ended up on the own branch on account of git shenanigans. PR based off this branch here: #90 |
Fixed by #90. Thanks all! |
This is basically functional with jlab 3 beta 8. The paths may need to be tweaked so the install works (e.g., the files are copied to the right places), etc., but the generated files seem to basically be in good order.
Right now this cookiecutter does not generate a jlab 2 package. It may be possible to generate and include both a jlab 2 and jlab 3 package.
CC @vidartf