@@ -101,7 +101,7 @@ class Resource(Generic[D]):
101
101
def from_contents (
102
102
cls ,
103
103
contents : D ,
104
- default_specification : Specification [D ] = None , # type: ignore[reportGeneralTypeIssues] # noqa: E501
104
+ default_specification : Specification [D ] = None , # type: ignore[reportGeneralTypeIssues]
105
105
) -> Resource [D ]:
106
106
"""
107
107
Attempt to discern which specification applies to the given contents.
@@ -116,18 +116,18 @@ def from_contents(
116
116
"""
117
117
specification = default_specification
118
118
if isinstance (contents , Mapping ):
119
- jsonschema_dialect_id = contents .get ("$schema" ) # type: ignore[reportUnknownMemberType] # noqa: E501
119
+ jsonschema_dialect_id = contents .get ("$schema" ) # type: ignore[reportUnknownMemberType]
120
120
if jsonschema_dialect_id is not None :
121
121
from referencing .jsonschema import specification_with
122
122
123
123
specification = specification_with (
124
- jsonschema_dialect_id , # type: ignore[reportUnknownArgumentType] # noqa: E501
124
+ jsonschema_dialect_id , # type: ignore[reportUnknownArgumentType]
125
125
default = default_specification ,
126
126
)
127
127
128
128
if specification is None : # type: ignore[reportUnnecessaryComparison]
129
129
raise exceptions .CannotDetermineSpecification (contents )
130
- return cls (contents = contents , specification = specification ) # type: ignore[reportUnknownArgumentType] # noqa: E501
130
+ return cls (contents = contents , specification = specification ) # type: ignore[reportUnknownArgumentType]
131
131
132
132
@classmethod
133
133
def opaque (cls , contents : D ) -> Resource [D ]:
@@ -183,7 +183,7 @@ def pointer(self, pointer: str, resolver: Resolver[D]) -> Resolved[D]:
183
183
else :
184
184
segment = segment .replace ("~1" , "/" ).replace ("~0" , "~" )
185
185
try :
186
- contents = contents [segment ] # type: ignore[reportUnknownArgumentType] # noqa: E501
186
+ contents = contents [segment ] # type: ignore[reportUnknownArgumentType]
187
187
except LookupError :
188
188
raise exceptions .PointerToNowhere (ref = pointer , resource = self )
189
189
@@ -192,11 +192,11 @@ def pointer(self, pointer: str, resolver: Resolver[D]) -> Resolved[D]:
192
192
resolver = self ._specification .maybe_in_subresource (
193
193
segments = segments ,
194
194
resolver = resolver ,
195
- subresource = self ._specification .create_resource (contents ), # type: ignore[reportUnknownArgumentType] # noqa: E501
195
+ subresource = self ._specification .create_resource (contents ), # type: ignore[reportUnknownArgumentType]
196
196
)
197
197
if resolver is not last :
198
198
segments = []
199
- return Resolved (contents = contents , resolver = resolver ) # type: ignore[reportUnknownArgumentType] # noqa: E501
199
+ return Resolved (contents = contents , resolver = resolver ) # type: ignore[reportUnknownArgumentType]
200
200
201
201
202
202
def _fail_to_retrieve (uri : URI ):
@@ -230,10 +230,10 @@ class Registry(Mapping[URI, Resource[D]]):
230
230
231
231
_resources : HashTrieMap [URI , Resource [D ]] = field (
232
232
default = HashTrieMap (),
233
- converter = HashTrieMap .convert , # type: ignore[reportGeneralTypeIssues] # noqa: E501
233
+ converter = HashTrieMap .convert , # type: ignore[reportGeneralTypeIssues]
234
234
alias = "resources" ,
235
235
)
236
- _anchors : HashTrieMap [tuple [URI , str ], AnchorType [D ]] = HashTrieMap () # type: ignore[reportGeneralTypeIssues] # noqa: E501
236
+ _anchors : HashTrieMap [tuple [URI , str ], AnchorType [D ]] = HashTrieMap () # type: ignore[reportGeneralTypeIssues]
237
237
_uncrawled : HashTrieSet [URI ] = EMPTY_UNCRAWLED
238
238
_retrieve : Retrieve [D ] = field (default = _fail_to_retrieve , alias = "retrieve" )
239
239
@@ -468,8 +468,8 @@ def combine(self, *registries: Registry[D]) -> Registry[D]:
468
468
uncrawled = self ._uncrawled
469
469
retrieve = self ._retrieve
470
470
for registry in registries :
471
- resources = resources .update (registry ._resources ) # type: ignore[reportUnknownMemberType] # noqa: E501
472
- anchors = anchors .update (registry ._anchors ) # type: ignore[reportUnknownMemberType] # noqa: E501
471
+ resources = resources .update (registry ._resources ) # type: ignore[reportUnknownMemberType]
472
+ anchors = anchors .update (registry ._anchors ) # type: ignore[reportUnknownMemberType]
473
473
uncrawled = uncrawled .update (registry ._uncrawled )
474
474
475
475
if registry ._retrieve is not _fail_to_retrieve :
0 commit comments