Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Conversation

jasongrout
Copy link
Member

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

@vidartf
Copy link
Member

vidartf commented Sep 21, 2020

It may be possible to generate and include both a jlab 2 and jlab 3 package.

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.

@jasongrout
Copy link
Member Author

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?

@vidartf
Copy link
Member

vidartf commented Sep 22, 2020

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",
Copy link
Member

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.

Copy link
Member

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 .",
Copy link
Member

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

@jasongrout
Copy link
Member Author

jasongrout commented Dec 24, 2020

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.

@ianhi
Copy link
Contributor

ianhi commented Jan 22, 2021

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, "*.*"),
Copy link
Member

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:

Suggested change
("share/jupyter/labextensions/%s" % labext_name, lab3_path, "*.*"),
("share/jupyter/labextensions/%s" % labext_name, lab3_path, "**"),

@jtpio
Copy link
Member

jtpio commented Jan 26, 2021

Hi, what more needs to happen here?

@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 install.json file)

Maybe something to put on the plate for next week if a couple of people are going to sprint on ipywidgets?

@ianhi
Copy link
Contributor

ianhi commented Feb 27, 2021

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?

@ianhi ianhi mentioned this pull request Feb 27, 2021
@ianhi
Copy link
Contributor

ianhi commented Feb 27, 2021

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

@jtpio
Copy link
Member

jtpio commented Mar 5, 2021

Fixed by #90.

Thanks all!

@jtpio jtpio closed this Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants