-
Notifications
You must be signed in to change notification settings - Fork 216
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
fix: Apply schema.json
normalization, add to docs
#1265
Conversation
schema.json
normalization, add to docsschema.json
normalization, add to docs
Welp, I don't know enough There are still a bunch of places where the pydantic model kinda falls down for in-IDE inspectability, e.g. human-readable A longer docs con (in addition to the raw Even more value can be squeezed from the schema with e.g typify, but again, I don't sling enough |
@@ -132,6 +132,9 @@ nav: | |||
- Community: Community.md | |||
- FAQ: FAQ.md | |||
|
|||
hooks: |
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.
great. we should use this for moving the install.sh
script as well cc @ruben-arts :)
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.
Indeed: my first foray into working the mkdocs
API. Not really worse than sphinx, but, ironically, much harder-to-read docs even though the API seems a little more sane/generalized.
Gah, somehow posting that comment reloaded an older version of this post, so lost some description stuff. No use crying about it, I suppose. Happy for any further feedback (or drive-by rust coding): no further changes planned from my side. |
Hey this looks really good! |
The most full-featured TOML tool that supports Once on PyPI, I'll likely work to get it added to the "well-known" specs on At the command line, it can do things like:
(which would, with the defaults, yield): diff --git a/pixi.toml b/pixi.toml
index 8df6b59..232b5e9 100644
--- a/pixi.toml
+++ b/pixi.toml
@@ -1,11 +1,13 @@
+"$schema" = "./schema/schema.json"
+
[project]
name = "pixi"
description = "Package management made easy!"
authors = [
- "Wolf Vollprecht <wolf@prefix.dev>",
- "Bas Zalmstra <bas@prefix.dev>",
- "Tim de Jager <tim@prefix.dev>",
- "Ruben Arts <ruben@prefix.dev>",
+ "Wolf Vollprecht <wolf@prefix.dev>",
+ "Bas Zalmstra <bas@prefix.dev>",
+ "Tim de Jager <tim@prefix.dev>",
+ "Ruben Arts <ruben@prefix.dev>",
]
channels = ["conda-forge"]
platforms = ["linux-64", "win-64", "osx-64", "osx-arm64"] good job! After adding an icky
The extension I've been using is:
This will use a
🤷 ?
Two of the testing examples already use the |
I guess some ways forward (not mutually exclusive):
Really up to you, happy to do some of the above, but will be out of pocket for a few days after tomorrow. |
Longer con, and outside my wheelhouse: using > pixi info
# ...
Project
------------
Manifest file: ~/pixi/pixi.toml
Config locations:
Last updated: 22-04-2024 15:25:27
Schema: https://pixi.sh/v0.19.0/schema/manifest/schema.json And theoretically eventually something deeper, which actually used knowledge about the changes between the schema versions to suggest that things have changed, either baked into the binary, or stored in the schema (ick): > pixi check
Project Schema: 0.19.0
You have pixi 0.20.0 installed which supports new schema features:
[tasks.*.env]
We now support `env` variables in the `task` definition, these can also be used as default values
for parameters in your task which you can overwrite with your shell's env variables.
task = {
cmd = "task to run",
env = { VAR="value1", PATH="my/path:$PATH" }
} |
"$defs": {
"Project" {
// ...
"x-taplo": {
"initKeys": ["name", "channels"]
}
} When closing off a I haven't spent any time actually trying to do that for any schema yet, and would see that as a follow-on activity. |
Thanks @bollwyvl for the additional explanation, that sounds really useful! Though I think all of that can be added later. This is already a nice improvement. I tried adding the schema to the pixi.toml but we use pixi in the CI so maybe add it after the new release. p.s. I love your write ups and conversations! Exceptionally high quality! |
Thanks for the kind words and speedy review, sorry for any TZ-related delay in looking at stuff.
This Is The Way. As is squash-merging my stream-of-consciousness commits. Thanks again! |
references
pixi.toml
schema syntax for human and machine consumption #1258changes
pydantic
model$id
and$schema
to generatedschema.json
pydantic
modelschema.json
null
(not representable in either TOML file)schema.json
to the docs site (underschema/manifest/schema.json
)scope="session"
fixture for the schema validation tests (anecdotally cuts time in about half)