Consider using TOML instead of YAML for pixi.lock
#1896
Replies: 4 comments
-
We have been discussing this internally as well. The biggest issue I see is how we make parser backwards compatible but perhaps first trying to read the file as toml and if that fails try yaml is good enough. |
Beta Was this translation helpful? Give feedback.
-
I would like to move this discussion to |
Beta Was this translation helpful? Give feedback.
-
That's what I had in mind as well |
Beta Was this translation helpful? Give feedback.
-
I think this is a good idea but Im moving it to the ideas discussions board because I dont know when we'll get to it. |
Beta Was this translation helpful? Give feedback.
-
Problem description
To my knowledge, the main reason YAML has been chosen for
pixi.lock
was to stay compatible with conda-lock. This goal has been abandoned by now: https://prefix.dev/blog/introducing_multi_env_pixi#the-new-pixilock-format-The main advantage of YAML IMO is that it is nicer with deeply nested structures. This doesn't apply here. Compare e.g. one package in YAML vs TOML:
YAML
TOML
One immediate advantage of TOML here is that the
package
namespace is easily visible. With YAML, you have to scroll all the way up to the beginning of the list. Not an easy task with large lock files.tomllib
is also part of the Python standard library, which makes reading TOML files more accessible than YAML.Lastly, serde_yaml is archived and was never a fantastic option to begin with, IMO.
It depends on unsafe-libyaml which is a C to unsafe Rust transcribed library implementing an outdated YAML version.
Beta Was this translation helpful? Give feedback.
All reactions