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

Incompatibility with jupyter_server 2.11.0 #1165

Open
LoicGrobol opened this issue Nov 21, 2023 · 9 comments · May be fixed by #1202
Open

Incompatibility with jupyter_server 2.11.0 #1165

LoicGrobol opened this issue Nov 21, 2023 · 9 comments · May be fixed by #1202
Milestone

Comments

@LoicGrobol
Copy link

Description

jupyter_server version 2.11.0 broke JupytextContentsManager, making jupytext unusable.

Reproduce

  1. Install both jupytext and jupyter_server==2.11.0
  2. Start jupyterlab jupyter lab (the issue also occurs with notebook though)
  3. Open the interface in a browser
  4. The interface fails to load properly (e.g. no file list) and errors appear in the console, most notably

TypeError: build_jupytext_contents_manager_class.<locals>.JupytextContentsManager.get() got an unexpected keyword argument 'md5'

This is most likely caused by the API change in jupyter-server/jupyter_server#1363 which made md5 part of the expected arguments to the contents managers get hook. A proper fix would be to update JupytextContentsManager accordingly, but in the meantime a hotfix would be to pin jupyter_server to <2.11.

@daviehh
Copy link

daviehh commented Nov 22, 2023

Might be a bit edge-case, but just limiting jupyter-server to <2.11 might not be enough since the script code generated by jupytext and the original ipynb file can get out of sync and throws an error

[W 2023-11-22 01:49:06.846 ServerApp] wrote error: 'test.ipynb (last modified 2023-11-22 05:03:33.603947+00:00) is more recent than test.py (last modified 2023-11-10 19:56:57.637370+00:00)\n\nDifferences
...

@fcollonval
Copy link
Contributor

I opened an issue upstream - don't work yet to a fix because there is a high chance that version will get yanked...

@mwouts
Copy link
Owner

mwouts commented Nov 22, 2023

Thanks @LoicGrobol for the detailed report. Very helpful ! Thanks also @fcollonval for the update, I will wait for further news then.

Also right now we are in the middle of a big update so it might take me/us one week or more before we can release a fix.

@Wh1isper
Copy link

Sorry for the breaking changes to the API. I have created jupyter-server/jupyter_server#1367 to fix this.

@owenlamont
Copy link

I saw jupyter-server 2.11.1 was released a few hours ago and I no longer get jupytext errors when launching Jupyter lab with it. This appears to be resolved.

@mwouts mwouts changed the title Incompatibility with jupyter_server 2.11 Incompatibility with jupyter_server 2.11.0 Nov 28, 2023
@fcollonval
Copy link
Contributor

Note for efficiency reasons, it will be nice to update the content manager to support the new hash introduced in jupyter-server/jupyter_server#1367

@mwouts
Copy link
Owner

mwouts commented Nov 28, 2023

Note for efficiency reasons, it will be nice to update the content manager to support the new hash introduced in jupyter-server/jupyter_server#1367

Yes! Please leave this issue open, I will look into this. If I read the code correctly, the require_hash argument will return a hash for the file content on disk. With Jupytext documents, a notebook might correspond to multiple files, so all that I will need is probably to find a way to combine multiple hashes into one?

Also thanks for adding the downstream test against Jupytext! I have a quick question about that. We have a release candidate jupytext==1.16.0rc0. The packaging has changed a lot in that version (in particular the docs should be included now). Is it possible to run the downstream test just once against that pre-release version? (I could well fork jupyter_server and run the action on my fork, but I am not sure where to specify the --pre argument).

@fcollonval
Copy link
Contributor

I don't think this is possible as I don't see an option in the action used: https://github.com/jupyterlab/maintainer-tools/blob/main/.github/actions/downstream-test/action.yml

You could open an issue there to see if it is possible.

@mwouts
Copy link
Owner

mwouts commented Dec 30, 2023

I don't think this is possible as I don't see an option in the action used: https://github.com/jupyterlab/maintainer-tools/blob/main/.github/actions/downstream-test/action.yml

Thanks for checking! No problem at all - I was just a little worried to break that test with the recent release of jupytext==1.16.0 but it went all fine!

@mwouts mwouts added this to the 1.17.0 milestone Jan 7, 2024
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 a pull request may close this issue.

6 participants