-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Updated Stubs for jsonschema #6486
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
22a09a1
Updated Stubs for jsonschema
kojiromike c0a7944
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1f82fcb
Update stubs/jsonschema/jsonschema/_types.pyi
kojiromike 979a7c9
Delete __main__.pyi
kojiromike 701ddf0
Delete compat.pyi
kojiromike 45d06a4
Update cli.pyi
kojiromike 3c21aaf
Update _format.pyi
kojiromike 27b8f09
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] affc7d1
Update validators.pyi
kojiromike 1e52a78
Remove Redundant Imports
kojiromike 5d99acc
Update _format.pyi
kojiromike 50b96cc
Add Back Optional Validators and Refine Types
kojiromike 539ce83
Further Refinements
kojiromike 0c7803c
Fix Failing CI
kojiromike 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 hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| version = "3.2.*" | ||
| version = "4.2.*" |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,42 @@ | ||
| from typing import Any | ||
| from typing import Any, Iterable | ||
|
|
||
| class FormatChecker: | ||
| checkers: Any | ||
| def __init__(self, formats: Any | None = ...) -> None: ... | ||
| def __init__(self, formats: Iterable[str] | None = ...) -> None: ... | ||
| def checks(self, format, raises=...): ... | ||
| cls_checks: Any | ||
| def check(self, instance, format) -> None: ... | ||
| def conforms(self, instance, format): ... | ||
| def conforms(self, instance, format) -> bool: ... | ||
|
|
||
| draft3_format_checker: Any | ||
| draft4_format_checker: Any | ||
| draft6_format_checker: Any | ||
| draft7_format_checker: Any | ||
| draft3_format_checker: FormatChecker | ||
| draft4_format_checker: FormatChecker | ||
| draft6_format_checker: FormatChecker | ||
| draft7_format_checker: FormatChecker | ||
| draft201909_format_checker: FormatChecker | ||
| draft202012_format_checker: FormatChecker | ||
|
|
||
| def is_email(instance): ... | ||
| def is_ipv4(instance): ... | ||
| def is_ipv6(instance): ... | ||
| def is_host_name(instance): ... | ||
| def is_idn_host_name(instance): ... | ||
| def is_uri(instance): ... | ||
| def is_uri_reference(instance): ... | ||
| def is_iri(instance): ... | ||
| def is_iri_reference(instance): ... | ||
| def is_datetime(instance): ... | ||
| def is_time(instance): ... | ||
| def is_regex(instance): ... | ||
| def is_date(instance): ... | ||
| def is_draft3_time(instance): ... | ||
| def is_css_color_code(instance): ... | ||
| def is_css21_color(instance): ... | ||
| def is_css3_color(instance): ... | ||
| def is_json_pointer(instance): ... | ||
| def is_relative_json_pointer(instance): ... | ||
| def is_uri_template(instance, template_validator=...): ... | ||
| def is_email(instance) -> bool: ... | ||
| def is_ipv4(instance) -> bool: ... | ||
| def is_ipv6(instance) -> bool: ... | ||
|
|
||
| # is_host_name is only defined if fqdn is installed. | ||
| def is_host_name(instance) -> bool: ... | ||
| def is_idn_host_name(instance) -> bool: ... | ||
| def is_uri(instance) -> bool: ... | ||
| def is_uri_reference(instance) -> bool: ... | ||
| def is_iri(instance) -> bool: ... | ||
| def is_iri_reference(instance) -> bool: ... | ||
| def is_datetime(instance) -> bool: ... | ||
| def is_time(instance) -> bool: ... | ||
| def is_regex(instance) -> bool: ... | ||
| def is_date(instance) -> bool: ... | ||
| def is_draft3_time(instance) -> bool: ... | ||
| def is_css_color_code(instance) -> bool: ... | ||
| def is_css21_color(instance) -> bool: ... | ||
| def is_json_pointer(instance) -> bool: ... | ||
| def is_relative_json_pointer(instance) -> bool: ... | ||
| def is_uri_template(instance) -> bool: ... | ||
|
|
||
| # is_duration is only defined if isoduration is installed. | ||
| def is_duration(instance) -> bool: ... | ||
| def is_uuid(instance) -> bool: ... | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| from typing import Any, ItemsView | ||
|
|
||
| def ignore_ref_siblings(schema) -> list[tuple[str, Any]] | ItemsView[str, Any]: ... | ||
| def dependencies_draft3(validator, dependencies, instance, schema) -> None: ... | ||
| def dependencies_draft4_draft6_draft7(validator, dependencies, instance, schema) -> None: ... | ||
| def disallow_draft3(validator, disallow, instance, schema) -> None: ... | ||
| def extends_draft3(validator, extends, instance, schema) -> None: ... | ||
| def items_draft3_draft4(validator, items, instance, schema) -> None: ... | ||
| def items_draft6_draft7_draft201909(validator, items, instance, schema) -> None: ... | ||
| def minimum_draft3_draft4(validator, minimum, instance, schema) -> None: ... | ||
| def maximum_draft3_draft4(validator, maximum, instance, schema) -> None: ... | ||
| def properties_draft3(validator, properties, instance, schema) -> None: ... | ||
| def type_draft3(validator, types, instance, schema) -> None: ... | ||
| def contains_draft6_draft7(validator, contains, instance, schema) -> None: ... | ||
| def recursiveRef(validator, recursiveRef, instance, schema) -> None: ... |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,24 @@ | ||
| from typing import Any | ||
| from typing import Callable, Iterable, Mapping | ||
|
|
||
| def is_array(checker, instance): ... | ||
| def is_bool(checker, instance): ... | ||
| def is_integer(checker, instance): ... | ||
| def is_null(checker, instance): ... | ||
| def is_number(checker, instance): ... | ||
| def is_object(checker, instance): ... | ||
| def is_string(checker, instance): ... | ||
| def is_any(checker, instance): ... | ||
| def is_array(checker, instance) -> bool: ... | ||
| def is_bool(checker, instance) -> bool: ... | ||
| def is_integer(checker, instance) -> bool: ... | ||
| def is_null(checker, instance) -> bool: ... | ||
| def is_number(checker, instance) -> bool: ... | ||
| def is_object(checker, instance) -> bool: ... | ||
| def is_string(checker, instance) -> bool: ... | ||
| def is_any(checker, instance) -> bool: ... | ||
|
|
||
| class TypeChecker: | ||
| def is_type(self, instance, type): ... | ||
| def redefine(self, type, fn): ... | ||
| def redefine_many(self, definitions=...): ... | ||
| def remove(self, *types): ... | ||
| def __init__(self, type_checkers=...) -> None: ... | ||
| def __lt__(self, other): ... | ||
| def __le__(self, other): ... | ||
| def __gt__(self, other): ... | ||
| def __ge__(self, other): ... | ||
| def __init__(self, type_checkers: Mapping[str, Callable[[object], bool]] = ...) -> None: ... | ||
| def is_type(self, instance, type: str) -> bool: ... | ||
| def redefine(self, type: str, fn: Callable[..., bool]) -> TypeChecker: ... | ||
| def redefine_many(self, definitions=...) -> TypeChecker: ... | ||
| def remove(self, *types: Iterable[str]) -> TypeChecker: ... | ||
|
|
||
| draft3_type_checker: Any | ||
| draft4_type_checker: Any | ||
| draft6_type_checker: Any | ||
| draft7_type_checker: Any | ||
| draft3_type_checker: TypeChecker | ||
| draft4_type_checker: TypeChecker | ||
| draft6_type_checker: TypeChecker | ||
| draft7_type_checker: TypeChecker | ||
| draft201909_type_checker: TypeChecker | ||
| draft202012_type_checker: TypeChecker |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,32 @@ | ||
| from typing import Any | ||
|
|
||
| from jsonschema._reflect import namedAny as namedAny | ||
| from jsonschema.validators import validator_for as validator_for | ||
| class _CannotLoadFile(Exception): ... | ||
|
|
||
| class _Outputter: | ||
| def __init__(self, formatter, stdout, stderr): ... | ||
| @classmethod | ||
| def from_arguments(cls, arguments, stdout, stderr): ... | ||
| def load(self, path): ... | ||
| def filenotfound_error(self, **kwargs) -> None: ... | ||
| def parsing_error(self, **kwargs) -> None: ... | ||
| def validation_error(self, **kwargs) -> None: ... | ||
| def validation_success(self, **kwargs) -> None: ... | ||
|
|
||
| class _PrettyFormatter: | ||
| def filenotfound_error(self, path, exc_info): ... | ||
| def parsing_error(self, path, exc_info): ... | ||
| def validation_error(self, instance_path, error): ... | ||
| def validation_success(self, instance_path): ... | ||
|
|
||
| class _PlainFormatter: | ||
| def __init__(self, error_format): ... | ||
| def filenotfound_error(self, path, exc_info): ... | ||
| def parsing_error(self, path, exc_info): ... | ||
| def validation_error(self, instance_path, error): ... | ||
| def validation_success(self, instance_path): ... | ||
|
|
||
| parser: Any | ||
|
|
||
| def parse_args(args): ... | ||
| def main(args=...) -> None: ... | ||
| def run(arguments, stdout=..., stderr=...): ... | ||
| def run(arguments, stdout=..., stderr=..., stdin=...): ... |
Empty file.
This file contains hidden or 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
This file contains hidden or 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
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.
Nit: It would be better to put these comments to the allowlist. You can add comments to end of line, e.g.
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 actually like them in the source file as well as the allowlist is basically invisible when developing with the stubs, while the comment in the source are visible when jumping into the stub file.