prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
2.95k stars 163 forks source link

Verify pixi schema against CLI #2057

Open bollwyvl opened 3 days ago

bollwyvl commented 3 days ago

Problem description

references

elevator pitch

Check for rust- (and cargo-) sensitive changes vs hard-coded values in the generated schema.

motivation

New platforms have appeared that the schema didn't know about.

Changes like this are pretty much guaranteed to happen again, and other classes of issues can be caught per-keystroke.

design ideas

During pixi r test-schema, for each schema/test/invalid/{name}.toml, e.g. bad_feature_platform.toml:

alternatives

ruben-arts commented 2 days ago

I 100% agree with this. Most of these hard coded things are not moved to often so we could just make simple code parser and verify that it's the same in python and in Rust. Otherwise making Python bindings for these parts and using the bindings in the model.py could also be helpful.

bollwyvl commented 2 days ago

Welp, could PR something that was like:

flowchart LR
  build([pixi r build]) --> pixi.exe -- $PIXI_TEST_BIN --> test-schema([pixi r test-schema])
  schema([pixi r generate-schema]) --> schema.json --> test-schema

This would be outside of my wheelhouse, but probably more efficient:

flowchart LR
  test-schema([pixi r test-schema])
  schema.json --> test([pixi r test])
  schema([pixi r generate-schema]) --> schema.json --> test-schema