-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Centralize METADATA.toml parsing in the test suite #9534
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
Conversation
@@ -162,46 +130,8 @@ def _find_stdlib_modules() -> set[str]: | |||
|
|||
def check_metadata() -> None: |
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.
At this point, this feels redundant since other tests will fail anyway. 😅
Unless you wanna use it as a smoke test.
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 get what you mean, but the other tests will assert the correctness of the METADATA.toml files "by accident". I feel like it's useful to have a test that asserts the correctness of the METADATA.toml files "on purpose"? That way we still have this guaranteed to be tested in CI, even if some other tests no longer need to get stuff from METADATA.toml files in the future, for whatever reason.
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.
Yeah that's what I meant by a smoke test (an easy test that says, if this fails, everything else will fail anyway, so it's easy to find the source of the error). Just wanted to know if it was on purpose :)
What about the |
I believe that if somebody did try to add a per-stub config section for mypy, |
This reverts commit c216b74.
We have various bits of logic scattered across the test suite to parse METADATA.toml files. This is a bug magnet: see e.g. #9532 (comment). (Failing CI run here: https://github.com/python/typeshed/actions/runs/3918898414/jobs/6699564673.) By centralizing the logic all in one place, we reduce the risk of bugs in our tests, and also improve type safety.
This PR centralizes METADATA.toml-parsing logic into a new file,
tests/parse_metadata.py
.