1
1
Fork
You've already forked jpterm
1

WIP: Make --experimental work with jupyter-server-nbmodel #3

Draft
cben wants to merge 1 commit from cben/jpterm:jupyter-server-nbmodel into main
pull from: cben/jpterm:jupyter-server-nbmodel
merge into: davidbrochart:main
davidbrochart:main
davidbrochart:textual-v3
davidbrochart:gh-pages
davidbrochart:asphalt5
davidbrochart:key-bindings
davidbrochart:assets
davidbrochart:fix-kernel-driver
First-time contributor
Copy link

jupyter lab server with jupyter-server-nbmodel extension needs "code" field (otherwise logs ValueError: code None must be a string) and also expects cell details nested under "metadata":
github.com/datalayer/jupyter-server-nbmodel@8bf649c71a/jupyter_server_nbmodel/handlers.py (L49-L58)

With these changes, jpterm --experimental works with it.

But will this break jupyverse? I don't have jupyverse working now, but its code destructures .../execute request into:

class Execution(BaseModel):
 document_id: str
 cell_id: str

and looks itself for the code:

content = {"code": str(ycell["source"]), "silent": False}

which is all consistent with existing jpterm code.

So I don't think you want to just merge this, I suppose the two servers better agree on /execute interface...

`jupyter lab` server with jupyter-server-nbmodel extension needs "code" field (otherwise logs `ValueError: code None must be a string`) and also expects cell details nested under "metadata": https://github.com/datalayer/jupyter-server-nbmodel/blob/8bf649c71a88508d9cca1dc9ad5befc60ff0ba2f/jupyter_server_nbmodel/handlers.py#L49-L58 With these changes, jpterm --experimental works with it. * I also had to follow https://codeberg.org/davidbrochart/jpterm/src/branch/main/docs/usage/CLI.md and disable ALL of token,password,xsrf. For most purposes, jpterm worked for me with auth if I include the `?token=...` in the --server value — but not with --experimental 🤷 But will this break jupyverse? I don't have jupyverse working now, but its code destructures .../execute request into: ``` class Execution(BaseModel): document_id: str cell_id: str ``` and [looks itself](https://github.com/jupyter-server/jupyverse/blob/62e65c30ee13433a41b175eac52f9f9b79fbbac9/plugins/kernels/fps_kernels/kernel_driver/driver.py#L171) for the code: ``` content = {"code": str(ycell["source"]), "silent": False} ``` which is all consistent with existing jpterm code. So I don't think you want to just merge this, I suppose the two servers better agree on /execute interface...
jupyter lab server with jupyter-server-nbmodel extension
needs "code" field (logs `ValueError: code None must be a string`)
and also expects cell details nested under "metadata".
But will this break jupyverse? I don't have jupyverse working now,
but its code destructures .../execute request into:
```
class Execution(BaseModel):
 document_id: str
 cell_id: str
```
and looks up itself for the code:
```
content = {"code": str(ycell["source"]), "silent": False}
```
which is all consistent with existing jpterm code.
Author
First-time contributor
Copy link

Let me know if you want a separate flag & code path to support both interfaces.

Let me know if you want a separate flag & code path to support both interfaces.

Sorry @cben I was not checking notifications on Codeberg, actually I'm switching back to GitHub.
Could you please open issues/PRs there?

Sorry @cben I was not checking notifications on Codeberg, actually I'm switching back to GitHub. Could you please open issues/PRs there?
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u jupyter-server-nbmodel:cben-jupyter-server-nbmodel
git switch cben-jupyter-server-nbmodel

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff cben-jupyter-server-nbmodel
git switch cben-jupyter-server-nbmodel
git rebase main
git switch main
git merge --ff-only cben-jupyter-server-nbmodel
git switch cben-jupyter-server-nbmodel
git rebase main
git switch main
git merge --no-ff cben-jupyter-server-nbmodel
git switch main
git merge --squash cben-jupyter-server-nbmodel
git switch main
git merge --ff-only cben-jupyter-server-nbmodel
git switch main
git merge cben-jupyter-server-nbmodel
git push origin main
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
davidbrochart/jpterm!3
Reference in a new issue
davidbrochart/jpterm
No description provided.
Delete branch "cben/jpterm:jupyter-server-nbmodel"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?