-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[ci] validate pyproject file by json schema #6813
Merged
+5
−0
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
51e55ef
dev
StrikerRUS 9937084
dev
StrikerRUS 04ecd90
dev
StrikerRUS 8e5f8c5
dev
StrikerRUS 1b57c05
dev
StrikerRUS cb19217
dev
StrikerRUS 838314b
dev
StrikerRUS 0a4d5ed
bump version
StrikerRUS 8da5506
Merge branch 'master' into ci/pyproject-lint
jameslamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I've read the docs of both projects, and want to be sure I understand... is the main benefit of
validate-pyproject-schema-store
overvalidate-pyproject
that it explicitly is tied to version of thepyproject.toml
schema?That's the impression I got from https://github.com/henryiii/validate-pyproject-schema-store/tree/main?tab=readme-ov-file#direct-usage
Or is it that by vendoring the schema file, you avoid a network call out to the internet every time
pre-commit
runs?Given that we always build with the latest
pip
,build
, andscikit-build-core
here, and that CI runs with total access to the internet and very rare network interruptions, I think we want to always keep up with the latestpyproject.toml
schema. And so think it would be better to usevalidate-pyproject
and ensure every CI run gets the latestpyproject.toml
schema.What do you think? Did I misunderstand?
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.
Initially I thought that it's good idea to pin the schema version and have a tight control over its updates. But I don't mind having the latest version always. Especially given that our dependabot doesn't update pre-commit hooks. I'll switch to
validate-pyproject
.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.
Hmm, I just checked with
[tool.ruff.lint.select] = [..., "non-existing"]
deep intentional error. Andvalidate-pyproject
validated successfully that file whilevalidate-pyproject-schema-store
failed with the following error:Given this difference in behavior of these two tools, do you still want to replace
validate-pyproject-schema-store
withvalidate-pyproject
?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.
Oh interesting. I still don't really understand the difference between these tools but... seeing the things
validate-pyproject-schema-store
is catching, I'm ok with trying it. Thanks for considering and testingvalidate-pyproject
.Let's merge this as-is.
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.
TBH, me too. I thought that
validate-pyproject-schema-store
is just a something like a caching wrapper for schemas, but seems that differences are bigger than I thought. OK, at least I can see all partial schemas here in the repo: https://github.com/henryiii/validate-pyproject-schema-store/tree/main/src/validate_pyproject_schema_store/resources and it makes me feel that all sections of the file are really validated.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.
OK, seems that behavior is documented:
And I can see only tool.setuptools table right after that passage.
UPD: More strong evidence:
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.
Ah ok, that explains it! Then yes, this makes me even more confident in using
validate-pyproject-schema-store
.