Skip to content

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!

@AlexWaygood AlexWaygood merged commit 82cccac into python:master Sep 3, 2022
@kkirsche kkirsche deleted the patch-11 branch September 6, 2022 13:08
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