-
Notifications
You must be signed in to change notification settings - Fork 386
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
JupyterLab Extension to Launch Text Notebooks #1154
Conversation
- Users should be able to create text notebooks in different formats - Launcher icons have been added to create text notebooks - Existing extension code has been refactored to split into logical files
- A dedicated Jupytext menu has been added to launch text notebooks
- Add dependencies needed for launching text notebooks
- Check properly if asked model is of jupytext or native format - Add few tests to ensure that jupytext contentsManager is creating files properly
- Repo organization does not permit to use native jupyterlab script - Small utility script has been added to create symlink of extension data while in dev mode
- Galata UI tests have been added to check jupytext extension
- Comparing colors can be a bit flaky given colors can vary across platforms - We use a maxDiffPixelRatio to smooth these issues out of tests
Hey @mahendrapaipuri wow, you've been busy, very impressed, that sounds like a very nice piece of work ! so just clarifying; this no longer supports jlab3, right ? imho that's the right approach btw thanks for pointing to playwright's UI mode, that somehow I had managed to miss at the time ;) |
Cheers @parmentelat! Yes, please test it when you can. We have moved to JupyterLab 4 and if users need to use it on JupyterLab 3 they need to pin to the last version of If we would like to have these features on JupyterLab 3 as well, we can backport it to the last stable release of @mwouts Do you think we can do a backport and make a release for JupyterLab 3 supported |
Hi @mahendrapaipuri , @parmentelat , well you've done a great job @mahendrapaipuri here again!! Thank you so much for this. I plan to test this tonight and/or tomorrow evening. Re the backport, we could consider that, however I perceive the upgrade from Jupyter 3 to Jupyter 4 as fairly straightforward so I'd rather not do a backport unless a few users ask specifically for it. |
Cheers @mwouts !!
I agree that the upgrade from JLab 3 to 4 is pretty straightforward. But I guess a lot of users (like us) are blocked due to the unavailability of extensions for JLab 4. But what you are proposing is quite reasonable. Lets try to cut a release for JLab 4 and if there are requests from users for its support on JLab 3, we can think about backporting. |
@mahendrapaipuri , how do you recommend to install the extension? I've used this:
but then I see an unexpected error message in the Jupyter logs:
and also when I run
I am afraid this might be very specific to my local installation (probably at some point I installed the npm extension and now it conflicts with the py one). Do you have recommendations on how to cleanup the previously installed extensions? Anyway I'll be back to this tomorrow evening (with a brand new env!) |
@mwouts That seems to me some issue with your environment. I always do a developmental install when changing source using In any case, if you get issues with extension, you can remove them from
Those steps should get you up and running! |
Thank you @mahendrapaipuri , I've been able to give a first quick try at the extension, it's really great! Your previous instructions were very helpful. I have updated accordingly Re the new Jupytext menu, I find it super useful! It's really great and so far it works very well. I am wondering if you see some way to incite the users to select the 'percent script' over the other types (that's the script format that I would recommend now). Maybe we could have that entry at the very top of the menu, and then have a menu separator before 'Light script' and the other ones? In the launcher I would say that there are two many Jupytext entries 😄 . Given that the 'open with' submenu introduces the concept of "Jupytext Notebook", do you think we could have a "Jupytext Notebook" section between "Notebook" and "Console" that would contain the different types of text notebooks? A few more things that I noticed:
I will do more testing in the coming days, and also try to make progress on the test reorganisation #1155 so that we can finally head to a new release soon! |
Yes, that sounds. We can have "percent script" on the top and add a separator after.
It is possible but the JupyterLab launcher is not very customizable. If we move them to a separate category An alternative here would be to give the users the ability to configure which Jupytext notebooks that they would like to have in the launcher via
I guess you mean double clicking? For me, when I double click a "Text Notebook", it opens always as a native file (either as |
Hi @mahendrapaipuri , ok great if you can move "percent script" at the very top of the Jupytext Menu, thanks! Personally I do like the Jupytext section in your screenshot above. No problem if it appears at the bottom. Also I think that we can expose less text notebooks, e.g. remove nomarker and hydrogen. I would recommend to use shorter names (without Jupytext since it's on the header), like e.g.
No worries if the icons don't have a Python icon. Actually that's an interesting point - these notebooks can have different languages/extensions, i.e. a percent script can well be a
Oh great that it works as intended on your end. I must have a residual old config here then. Thanks for confirming. |
Actually we can use
Yes, this is because we are replacing
Exactly!! I think this is something we should try to improve for the next iteration. Created #1157 to keep track of this issue. |
Hiya folks I still have not been able to test @mahendrapaipuri's super appealing work, but have some thoughts/comments from reading this thread so far
in any case, thanks again so much @mahendrapaipuri for this very welcome contribution ! |
- Users will be able to configure category of Text notebooks in launcher - Users can configure which formats should be added to launcher - These configs will be available via Settings in JupyterLab
@mwouts @parmentelat I have added ability to configure both I have also added a small docs about extension with few screenshots. Please test the patch when you can and let me know. |
Awesome thank you @mahendrapaipuri! I will definitely test this over the weekend. Looking forward to merging this! |
Codecov Report
@@ Coverage Diff @@
## main #1154 +/- ##
==========================================
+ Coverage 94.99% 95.11% +0.11%
==========================================
Files 29 29
Lines 4419 4419
==========================================
+ Hits 4198 4203 +5
+ Misses 221 216 -5 see 2 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
``` | ||
|
||
While running `jlpm watch`, every saved change to a `.ts` file will immediately be |
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.
This is very helpful! Thanks!
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.
about jlpm watch
it is indeed very convenient, just keep in mind the .ts
part, because it won't trigger if you only change a .json
though, so in these cases it is important to kill it and restart it, at least that was my experience; I'm unsure about .css
files, so out of safety I am used to relaunching jlpm watch too
, it may be unnecessary.
@@ -0,0 +1,167 @@ | |||
# Integration Testing | |||
|
|||
This folder contains the integration tests of the extension. |
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.
Very impressive! And helpful as it will allow us to make future changes! Thanks @mahendrapaipuri
This is a first attempt to launch text notebooks (which was a feature available in the legacy notebook (<7)) from JupyterLab and new Notebook interfaces. List of features added:
contentsManager.new_untitled
to make sure we cover cases with and withoutjupytext
.So, users have multiple options now on how they want to launch text notebooks. A screenshot of new extension looks as follows in JupyterLab:
Note that this extension is tested and being tested in CI for only JupyterLab 4 and Notebook 7
Integration tests:
jupytext
are working wellui-tests
folder on how to run galata tests@mwouts @parmentelat Could you please test this patch? I have done some basic tests but I am not a user of
jupytext
, so not sure if everything is working well. If you think we can name the launcher icons better, please let me know.@mwouts I tried to re-organize the source code of extension to be more clean and easy to follow. I didnt get some parts of the code, they seem to be bit vestigial but I did not remove them. If you have some time, cleaning it up and adding some comments would help the maintainability of the extension source code.
Hoping for CI to go green
Closes #1095