Skip to content

feat: add pyproject.toml schema#5583

Merged
ruben-arts merged 15 commits intoprefix-dev:mainfrom
bollwyvl:gh-1089-pyproject-schema
Mar 16, 2026
Merged

feat: add pyproject.toml schema#5583
ruben-arts merged 15 commits intoprefix-dev:mainfrom
bollwyvl:gh-1089-pyproject-schema

Conversation

@bollwyvl
Copy link
Contributor

Description

References:

As always, thanks so much for pixi! ❤️

This starts the groundwork for improving the editing experience of [tool.pixi] in pyproject.toml.

Once published, a pyproject.toml author could (at least initially) add a comment like:

# pyproject.toml
#:schema https://pixi.sh/v0.xx.y/schema/manifest/pyproject/schema.json

...and start getting interactive features like completion, signature display, validation, etc.

image

Future work (likely not by maigc CI token-averse me) could automate updating the partial-pixi.json to schemastore on release, such that even without a comment or $schema, completing .ptab would start offering up-to-date pixi options. Of course, #2748 would help the next step a lot! 😜

Changes:

  • pixi.toml
    • use jsonschema-rs, relock
      • this was easier than wrangling types-jsonschema, and is faster/has no dependencies

  • schema/
    • model.py
      • generate pyproject/schema.json
      • generate pyproject/partial-pixi.json as per other tools on schemastore
    • test_manifest.py
      • add type hints, remove typechecker magic comments
      • test all discovered ../**/**/pyproject.toml with the full and partial schema
      • add a couple examples (happened to pick choices)
    • docs_hooks.py
      • deploy to site/schema/manifest/pyproject/

How Has This Been Tested?

  • put all existing pyproject.toml under test in test_manifest.py
  • add a few valid and invalid fixtures

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

@bollwyvl bollwyvl changed the title Add pyproject schema feat: add pyproject.toml schema Feb 28, 2026
@bollwyvl bollwyvl marked this pull request as ready for review February 28, 2026 22:22
Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @bollwyvl, one small comment.

Great drive by improvements to the tests and schema generation in general! Thanks

@ruben-arts ruben-arts enabled auto-merge (squash) March 16, 2026 13:46
@bollwyvl
Copy link
Contributor Author

Thanks for the review, have updated, and even found an opportunity to shave a bit more time off with jsonschema-rs by skipping json.parse... it works, but the upstream types need updating, and certainly not a blocker, as only 3 validators get built.

@ruben-arts ruben-arts merged commit 831cae8 into prefix-dev:main Mar 16, 2026
41 checks passed
@bollwyvl
Copy link
Contributor Author

Thanks!

@bollwyvl bollwyvl deleted the gh-1089-pyproject-schema branch March 16, 2026 14:13
mohitdebian pushed a commit to mohitdebian/pixi that referenced this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants