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

Fix jsonschema._format.pyi to match upstream #8673

Merged
merged 4 commits into from
Sep 3, 2022
Merged

Fix jsonschema._format.pyi to match upstream #8673

merged 4 commits into from
Sep 3, 2022

Conversation

kkirsche
Copy link
Contributor

@kkirsche kkirsche commented Sep 2, 2022

This updates the types in jsonschema._format.pyi to match the upstream source's type hints:

https://github.com/python-jsonschema/jsonschema/blob/main/jsonschema/_format.py

JSONSchema's typeshed version is 4.15.*:
https://github.com/python/typeshed/blob/master/stubs/jsonschema/METADATA.toml

which was released two days ago:
https://github.com/python-jsonschema/jsonschema/releases/tag/v4.15.0

So the use of master as a reference is not a big concern here.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

The stubtest error is a stubtest bug that's already fixed on mypy master. You'll just need to allowlist it for now, we can remove the allowlist entry as soon as mypy 0.980 is out.

@kkirsche
Copy link
Contributor Author

kkirsche commented Sep 2, 2022

I've added a fix, but also installed https://github.com/python-jsonschema/jsonschema/blob/main/pyproject.toml#L46 as an extras so that theoretically the other is_* calls should not require the stubtest_allowlist. I'll revert that if needed. This was determined by looking at the comments in the stubs which indicate that some of the is_* functions are only available when specific dependencies are installed.

@kkirsche
Copy link
Contributor Author

kkirsche commented Sep 2, 2022

The stubtest error is a stubtest bug that's already fixed on mypy master. You'll just need to allowlist it for now, we can remove the allowlist entry as soon as mypy 0.980 is out.

Seems like that Mypy behavior ended up being a net positive by reducing the usage of stubtest_allowlist for this package :) Thanks for the feedback on that

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

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