-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add first set of schemas and a simple Python package for distributing schemas #1
Conversation
I started by adding Jupyter Server's event schemas, since these are relatively low risk set of schemas to begin with. NBFormat would be a good one to add next. Once this is merged and released, Jupyter Server can depend on this package to install and locate its event schemas. |
Thanks for starting. I think nbformat is a... big bite of the elephant to swallow. In my crazy fever dream, i'm seeing something grounded in a known set of mimetypes (mostly our home-grown non-IANA-registered ones), which build all the way up to the client-facing APIs. flowchart TD
subgraph schema
mimetypes --> kernelspec & contents & nbformat
kernelspec --> nbformat
nbformat --> contents
mimetypes --> messages
end
subgraph openapi
jupyter_server
end
subgraph asyncapi
kernel_messaging
widgets
end
nbformat & kernelspec & contents --> jupyter_server
messages --> kernel_messaging & widgets
The other deal is the efficient and humane authoring and review of these things. To that end, I'm imagining having "source of truth" schema in Finally, in addition to the raw schema, we probably want to look at low-dependency (maybe For js, there is a lot of great tools out there for generated For py, I've had some success with jsonschema-gentypes. End of the day, I think this repo will end up being a monorepo in the language (and language-specific-dependency) space... |
A couple of comments on the three example schemas:
Other than that I would inclined to merge this soon and we can build on top of it. I've had a look at writing schemas that are reused in other schemas (e.g. kernel message |
It looks like there are two different repos for this work:
|
👍
This is a side effect of using JSON instead of e.g. YAML for authoring schemas. In fact, they are probably there because I took the YAML schemas from here and converted them to JSON using a
If not in this PR, the next PR should be focused on a better authoring/reviewing flow. It's much more pleasurable to read and review schemas in yaml or toml than JSON, but we'll probably need to setup CI or pre-commit to do the conversion.
👍 |
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = ["jupyter_core"] |
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.
It's important to note here that we are making jupyter_core
a dependency of jupyter_schemas
. This means we (ideally) won't have any schemas in jupyter_core, which would create a circular dependency.
I think this is fine, but I'm flagging here in case anyone else has concerns.
It looks like this was resolved in the Jupyter Server meeting. This repo will remain while the jupyter-standards repo was archived. |
Yes, @bollwyvl explained in the Jupyter Server meeting that these descriptions already exist elsewhere in this form and we should use precisely the same text.
I have some demo code for conversion between JSON, YAML and TOML, and also for (semi-) automatic generation of sphinx docs in all the various formats. PR to follow shortly. |
In the SSC meeting today, we moved the Github Pages pointer to a new "stable" branch. This allows us to merge this PR without it going "live". I think (and others like @JohanMabille and @ianthomas23 agreed in the meeting) that we merge this and iterate in #4. |
I took a crack at getting things started here. Let me know what you think.
Following the pattern set by Vega here: https://github.com/vega/schema
This adds a simple README with info about authoring a schema.
The schemas should render under the correct URI, e.g.
schema.jupyter.org/jupyter_server/events/content_service/v1.json
.I've included a super simple Python package that installs the schemas under Jupyter's data directory. I've also include some simple utility functions to list and loads these schemas.
@fcollonval @afshin @bollwyvl