Skip to content
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

feat: add schema and validate-pyproject support #1622

Merged
merged 4 commits into from Sep 26, 2023

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Sep 19, 2023

Adding a json schema. This supports validate-pyproject, allowing it to check a tool.cibuildwheel section. I wrote a Python 3.10+ bin/generate_schema.py to make the schema as I didn't see a good way to do the OS sections and overrides by hand. I mostly tried to replicate the current behavior, though we technically could be more strict with a schema than in reality, since it's optional to validate it.

Testing by validating the defaults toml, a few manual examples, and running all the docs examples though.

Once we have this, we could also contribute it to SchemaStore, which would make it work in vscode, etc.

Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

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

This is really cool, I didn't know about this. Getting auto-complete in vscode would be amazing.

unit_test/validate_schema.py Outdated Show resolved Hide resolved
unit_test/validate_schema.py Outdated Show resolved Hide resolved
bin/generate_schema.py Outdated Show resolved Hide resolved
bin/generate_schema.py Outdated Show resolved Hide resolved
bin/generate_schema.py Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii
Copy link
Contributor Author

Also added a mechanism to test all the docs examples. Several fixes of the schema came from that. :)

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

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

Looks good! Testing with the docs samples is a very cool idea.

@henryiii henryiii merged commit d4af0ac into pypa:main Sep 26, 2023
19 of 24 checks passed
@henryiii henryiii deleted the henryiii/feat/schema branch September 26, 2023 16:23
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.

None yet

2 participants