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

Add extension for Jupyter Notebook 7 #425

Merged
merged 28 commits into from
Sep 22, 2023
Merged

Conversation

bollwyvl
Copy link
Collaborator

@bollwyvl bollwyvl commented Sep 19, 2023

References

Changes

  • UI
  • python
    • update dependency ranges
  • js/ts
    • handle missing ILauncher
    • extract a number of constants and types to tokens.ts
    • adds a local prettier install to account for CI updates
      • pre-commit won't do the PR update if you mess with CI

    • update typescript
  • testing
    • use session scoped server fixture
    • increase
  • CI
    • build once in CI, download into others
    • run full pytest suite in single step
      • acceptance test coverage is then included in the HTML coverage report

Screens

a screenshot of the notebook 7 interface

Breaking Changes

  • shouldn't change the signature of anything

@bollwyvl bollwyvl changed the title Start nb7 support Support Jupyter Notebook 7 Sep 19, 2023
labextension/.yarnrc.yml Show resolved Hide resolved
labextension/.yarnrc.yml Outdated Show resolved Hide resolved
@bollwyvl bollwyvl marked this pull request as ready for review September 21, 2023 03:16
.github/workflows/test.yaml Outdated Show resolved Hide resolved
Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good from the technical perspective, but I'm not confident at all on the extension code =/

There is some documentation that is worth updating as part of this I think. We have a "labextesion" folder, but its now an extension for JupyterLab 3-4, and an extension for Notebook 7? I didn't know about it, but there was some behavior in notebook 6 also?

As you probably overview the typescript code base quite well at this point, could you provide some code contributor / maintainer facing docs overviewing what the various code files does?

EDIT: removed resolved comment.

tests/acceptance/test_acceptance.py Outdated Show resolved Hide resolved
labextension/package.json Show resolved Hide resolved
Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working this @bollwyvl!!! ❤️ 🎉 🌻

I've struggled a bit since this is not a domain I have much experience in, but I have some suggestions related to docs to a large extent.

  • Resolve comment about NOTEBOOK_VERSION
  • Revise README.md's heading ### JupyterLab extension
  • Revise labextension/README.md
    • Is this a Notebook 7 + JupyterLab extension now?
    • Is it a Notebook 6 extension somehow also? I was surprised about the notebook 7 functionality added already was found in notebook 6.
  • (optional) Add top-level comments for .ts files providing a high level overview in a paragraph or two
    • Something like this will help me greatly as a novice about code for frontend extensions in reviewing or possibly fixing a bug etc.

@consideRatio
Copy link
Member

I've observed a few address already in use failures, I'm not sure if they have started showing up more and more with this PR or not, but they are quite frequent now. I've seen them about ~50% of the times the tests run.

Could it be related to making fixtures session based?

@bollwyvl
Copy link
Collaborator Author

Revise labextension/README.md

This populates the entry on npmjs.org, but as this package hasn't been published under its current name, it's... not. I've updated the main README with a compatibility matrix, which is likely more relevant.

Is this a Notebook 7 + JupyterLab extension now?

Yes, that's the point of this PR. Notebook 7 is built of 95% jupyterlab components, so mostly everything works the same, but you have to watch out for notebookPage.

Is it a Notebook 6 extension somehow also? I was surprised about the notebook 7 functionality added already was found in notebook 6.

Yes, the existing tree.js still does the thing. I, for one, would not sign up to add new features there, as notebook<7, nbclassic is really on life support at this point, with basically no non-emergency maintainers. But as it's only two files, there's no particular harm in keeping it, as it doesn't force another build.

@consideRatio consideRatio changed the title Support Jupyter Notebook 7 Add extension for Jupyter Notebook 7 Sep 22, 2023
Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, and with the amazing work with browser tests I think we can go for a merge even though I'm not so confident reviewing the frontend code. What do you think @bollwyvl?

@bollwyvl
Copy link
Collaborator Author

address already in use failures

This one's tricky. Getting rid of the hard-coded port (e.g. NOT_54321_PORT = get_unused_port()) would for sure get rid of this, but it might be indicative of a deeper cleanup problem... perhaps the atexitasync stuff isn't firing properly, or some other async shenanigans? Perhaps it's not interacting correctly with pytest's freaky stuff?

@bollwyvl
Copy link
Collaborator Author

go for a merge

Sure, why not. Could do an 4.1.0a0 or something to try it out, but we've done the best we can to not break anything, and sometimes only peoples' unpinned prod environments find the bugs.

@consideRatio
Copy link
Member

I opened #426 about the intermittent test failrues, lets go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants