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

Support JupyterLab 4 #40

Merged
merged 11 commits into from
Nov 15, 2023
Merged

Support JupyterLab 4 #40

merged 11 commits into from
Nov 15, 2023

Conversation

i-aki-y
Copy link
Collaborator

@i-aki-y i-aki-y commented Oct 21, 2023

This PR upgrades the extension to support JupyterLab 4 (fix #39 ).
I used the jupyterlab.upgrade_extension script according to this migration guide:

https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html

pip install -U jupyterlab
pip install "copier~=8.0" jinja2-time tomli-w
pip install jupyter_packaging
python -m jupyterlab.upgrade_extension .

After the script application, I added some manual fixes (see the commit log for details):

  • LICENSE.txt --> LICENSE
  • Revert strictNullChecks in tsconfig.json: true --> false
  • Remove old python package jupyterlab-notification (jupyterlab_notification is created by script)
  • Modified the source code because the new API breaks backward compatibility (Only one fix).
  • Increment the version 0.4.1 --> 0.5.0

Here is the log of jupyterlab.upgrade_extension script:

Copying from template version 4.2.2
    create  .
    create  jupyterlab_notifications
    create  jupyterlab_notifications/__init__.py
    create  CHANGELOG.md
    create  src
    create  src/index.ts
    create  setup.py
    create  .copier-answers.yml
    create  tsconfig.json
    create  style
    create  style/index.css
    create  style/base.css
    create  style/index.js
    create  LICENSE
    create  .gitignore
    create  .yarnrc.yml
    create  .prettierignore
    create  README.md
    create  install.json
    create  package.json
    create  pyproject.toml
    create  binder
    create  binder/environment.yml
    create  binder/postBuild
    create  RELEASE.md
    create  schema
    create  schema/plugin.json
    create  .github
    create  .github/workflows
    create  .github/workflows/enforce-label.yml
    create  .github/workflows/publish-release.yml
    create  .github/workflows/check-release.yml
    create  .github/workflows/prep-release.yml
    create  .github/workflows/binder-on-pr.yml
    create  .github/workflows/build.yml


Overwrite scripts in package.json? [n]: y
overwrite "tsconfig.json"? [y]:
overwrite "README.md"? [n]:
overwrite "setup.py"? [y]:
overwrite "install.json"? [n]:
overwrite "pyproject.toml"? [y]:
overwrite ".gitignore"? [y]:
overwrite ".github/workflows/build.yml"? [y]:
overwrite "schema/plugin.json"? [n]:
overwrite "src/index.ts"? [n]:
overwrite "binder/environment.yml"? [n]:
** Updated scripts in package.json
** DELETED .eslintrc.js
** DELETED .eslintignore
** DELETED .prettierrc
** skipped _temp_extension/README.md
** skipped _temp_extension/install.json
** skipped _temp_extension/schema/plugin.json
** skipped _temp_extension/src/index.ts
** skipped _temp_extension/binder/environment.yml
** DELETED setup.cfg
** DELETED MANIFEST.in
** Remove _temp_extensions directory when finished

Some comments about the upgrade script:

The following configs look to be included in package.json.

** DELETED .eslintrc.js
** DELETED .eslintignore
** DELETED .prettierrc

The upgrade script changes build toolchains from the setuptools to the hatchling (https://hatch.pypa.io/latest/).
The build settings are now found in pyproject.toml instead of setup.*.

** DELETED setup.cfg
** DELETED MANIFEST.in

The RELEASE.md explains the new release flow.

This upgrade also adds some .github/workflows/*.
I did not examine how they work actually, but they use the jobs defined in the following repositories:
https://github.com/jupyterlab/maintainer-tools
https://github.com/jupyter-server/jupyter_releaser

The CHANGELOG.md is almost empty now, but the workflow requires it, so I left it.

@i-aki-y i-aki-y added the enhancement New feature or request label Oct 21, 2023
@i-aki-y i-aki-y changed the title Support JupyterLab 4 [WIP]Support JupyterLab 4 Oct 21, 2023
@i-aki-y i-aki-y added maintenance and removed enhancement New feature or request labels Oct 21, 2023
@i-aki-y i-aki-y changed the title [WIP]Support JupyterLab 4 Support JupyterLab 4 Oct 21, 2023
@i-aki-y i-aki-y requested a review from mwakaba2 October 21, 2023 10:05
@mwakaba2
Copy link
Owner

mwakaba2 commented Nov 6, 2023

@i-aki-y thanks so much for working on this, and apologies for the delay. I'll be able to review this some time this week.
In the meantime, can I add you as a maintainer on https://pypi.org/project/jupyterlab-notifications/ ?
You would have permissions to publish the latest version in pypi. If interested, please let me know your pypi username!

@mwakaba2 mwakaba2 self-requested a review November 7, 2023 01:21
Copy link
Owner

@mwakaba2 mwakaba2 left a comment

Choose a reason for hiding this comment

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

just one suggestion, but everything looks great!

i-aki-y and others added 2 commits November 11, 2023 12:04
Co-authored-by: Mariko Wakabayashi <mariko@mwkby.com>
@i-aki-y
Copy link
Collaborator Author

i-aki-y commented Nov 11, 2023

@mwakaba2 thank you for your time.

I also corrected the package name defined in pyproject.toml that was overwritten by the upgrade script:

name = jupyterlab_notifications -> name = jupyterlab-notifications

I think this should be the same as the name previously defined in setup.py

You would have permissions to publish the latest version in pypi. If interested, please let me know your pypi username!

Sure, I made this pypi account: https://pypi.org/user/i-aki-y/

@mwakaba2
Copy link
Owner

mwakaba2 commented Nov 15, 2023

awesome, thanks @i-aki-y ! I invited you as an owner of the package, so you now have the power to publish it. 🔥
Would you like to publish it? If not, I'll probably be able to publish it sometime this weekend.

@mwakaba2 mwakaba2 merged commit 153ea36 into mwakaba2:main Nov 15, 2023
5 checks passed
@i-aki-y
Copy link
Collaborator Author

i-aki-y commented Nov 16, 2023

@mwakaba2 Thanks! I accepted pypi invitation.

Would you like to publish it?

OK, I would like to try this release to confirm the release process.
I think I can do it this weekend.

@i-aki-y
Copy link
Collaborator Author

i-aki-y commented Nov 18, 2023

@mwakaba2 Now, I published the new version 0.5.0!
https://pypi.org/project/jupyterlab-notifications/

I confirmed that pip -U installs the new version and it works on jupyterlab4.0.8.

@mwakaba2
Copy link
Owner

@i-aki-y awesome, thank you! 🙌

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

Successfully merging this pull request may close these issues.

JupyterLab 4 / Jupter Notebook 7 support
2 participants