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

Upgrade topbar extensions to JupyterLab 4 #92

Merged
merged 27 commits into from
Jul 24, 2023

Conversation

mahendrapaipuri
Copy link
Member

Closes #81

@jtpio jtpio added the enhancement New feature or request label Jun 24, 2023
@jtpio
Copy link
Member

jtpio commented Jun 24, 2023

Nice thanks @mahendrapaipuri for working on this!

.stylelintcache Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this file can be added to the .gitignore

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, totally. Cheers for pointing it out!!

- [jupyterlab-logout](https://github.com/jupyterlab-contrib/jupyterlab-logout): add a "Log Out" button
- [jupyterlab-theme-toggle](https://github.com/jtpio/jupyterlab-theme-toggle): switch between the Light and Dark themes
- [jupyterlab-topbar-text](./packages/topbar-text-extension): add and edit custom text
- [jupyterlab-system-monitor](./packages/system-monitor-extension): show system metrics (memory usage)
Copy link
Member

Choose a reason for hiding this comment

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

For jupyterlab-system-monitor either we include it here, or maybe directly in jupyter-resource-usage? jupyter-server/jupyter-resource-usage#191

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that it makes more sense to move it over to jupyter-resource-usage as users can install everything at once. I will work on that!!

Copy link
Member

Choose a reason for hiding this comment

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

that would be great, thanks!

Copy link
Member

Choose a reason for hiding this comment

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

For reference there is a PR to update jupyter-resource-usage to JupyterLab 4: jupyter-server/jupyter-resource-usage#195, that could be finished before jupyter-server/jupyter-resource-usage#191.

Or update to JupyterLab 4 directly as part of jupyter-server/jupyter-resource-usage#191.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jtpio How do we organise the jupyter-resource-usage? Should I wait for you to finish your PR and then add the lab extension package?

Copy link
Member

Choose a reason for hiding this comment

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

I'll have very low bandwidth over the next 2 weeks so if you want to take over and finish the lab 4 PR that would be greatly appreciated. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I can do that. Are you going to add me as a collaborator or should I start a new PR with your branch as base?

@mahendrapaipuri mahendrapaipuri marked this pull request as draft June 25, 2023 09:00
# This file is auto-generated by Hatchling. As such, do not:
# - modify
# - track in version control e.g. be sure to add to .gitignore
__version__ = VERSION = '1.0.0'
Copy link
Member

Choose a reason for hiding this comment

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

+1 for going with 1.0.0 for all these extensions 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

And _version.py must be ignored as well. Will fix these soon.

Will add this extension to the jupyter-resource-usage repo.

See #195, #191 in  jupyter-resource-usage
Remove _version.py files from VCS. Hatchling will handle them directly.
@mahendrapaipuri mahendrapaipuri marked this pull request as ready for review June 27, 2023 15:37
@jtpio
Copy link
Member

jtpio commented Jul 17, 2023

Thanks again @mahendrapaipuri for working on this.

I updated the repo settings so the CI should run when new changes are pushed, to reduce friction.

Mistakenly we were using coreutils 4.0.0 which made
topbar-text extension outdated
@mahendrapaipuri
Copy link
Member Author

@jtpio Fixed issues with CI. This PR is good to go for the review.

I dont have an awful lot of experience with GitHub workflows. I tried to modernise the actual CI workflows without changing the way the packages are being tested. If you think, we can improve/optimize the existing workflows, please let me know.

// Get app commands
const { commands } = app;

const namespace = 'topbarcmds';
Copy link
Member

Choose a reason for hiding this comment

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

For consistency with other third-party extensions, should we rename the namespace to jupyterlab-logout?

Suggested change
const namespace = 'topbarcmds';
const namespace = 'jupyterlab-logout';

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you think about jupyterlab-topbar as namespace? It will still be project specific namespace and we will be able to use same namespace for any future buttons we will add to topbar.

Copy link
Member

Choose a reason for hiding this comment

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

That could indeed work, unless we consider all these extensions as independent and the first part of the command (namespace) to correspond to the name of the extension.


import '../style/index.css';

const logoutPluginId = '@jupyterlab/logout-extension:plugin';
Copy link
Member

Choose a reason for hiding this comment

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

Since this is not an official extension, maybe the following name would be more appropriate?

Suggested change
const logoutPluginId = '@jupyterlab/logout-extension:plugin';
const logoutPluginId = 'jupyterlab-logout-extension:plugin';

Copy link
Member

Choose a reason for hiding this comment

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

For consistency we could then do the same with the other extensions in this repo / diff.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough. I thought this convention was put in-place when extensions were distributed as npm packages to put all official extensions under one umbrella namespace. As this is not the case anymore, I thought we could use this convention so that all extensions will be installed at same location for the end users.

Anyways, I will change the names for all extensions.

Remove badges from README of packages

Remove references to jupyterlab-resource-monitor in README.
Add a note that the package can be installed from jupyter-resource-usage

Add postBuild file for binder
Change extension names from @jupyterlab-* to jupyterlab-*
to avoid clashing with official extensions

Use jupyterlab-topbar as command namespace for logout extension
@@ -0,0 +1,84 @@
{
"name": "jupyterlab-logout-extension",
Copy link
Member

Choose a reason for hiding this comment

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

Should the npm name keep the -extension suffix? Or just be jupyterlab-logout like the current name on npm? https://www.npmjs.com/package/jupyterlab-logout

Copy link
Member

Choose a reason for hiding this comment

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

Just so that when we make a release later with this change we still publish to the same package on npm.

@@ -0,0 +1,87 @@
{
"name": "jupyterlab-theme-toggler-extension",
Copy link
Member

Choose a reason for hiding this comment

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

Similar comment as above, maybe we should stick to jupyterlab-theme-toggle for now?

https://www.npmjs.com/package/jupyterlab-theme-toggle

@jtpio
Copy link
Member

jtpio commented Jul 19, 2023

Thanks @mahendrapaipuri for your work on this 👍

I left a few more comments about how to name the npm packages. Looks like the PR should be good to go. We could also merge and iterate in follow-up PRs.

One thing to check in a separate PR would be to add support for the Jupyter Releaser so we can automate the publishing of all the Python packages (and npm) in the monorepo.

@mahendrapaipuri
Copy link
Member Author

Happy to contribute and thanks to you too @jtpio for helping me out.

Addressed all your PR comments. Yes, I think we can add support for releaser in a separate PR.

I see that you merged #195 that adds JLab 4 support for jupyter-resource-usage. I will put up a PR with jupyterlab-resource-usage extension added to that project.

Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks!

This looks good to go. As mentioned in the comments we'll have to check how to setup the versioning of the extensions so releases can be made with the Jupyter Releaser.

@jtpio
Copy link
Member

jtpio commented Jul 24, 2023

I see that you merged #195 that adds JLab 4 support for jupyter-resource-usage. I will put up a PR with jupyterlab-resource-usage extension added to that project.

Yes that would be great, thanks!

@jtpio jtpio merged commit 33be88b into jupyterlab-contrib:main Jul 24, 2023
@mahendrapaipuri mahendrapaipuri deleted the upgrade_to_jl4 branch September 26, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate the extension for JupyterLab 4.0
2 participants