|
220 | 220 |
|
221 | 221 | # A mapping of {<member name>: (package, <module name>)} defining dynamic imports |
222 | 222 | _dynamic_imports: 'dict[str, tuple[str, str]]' = { |
223 | | - 'dataclasses': (__package__, '__module__'), |
| 223 | + 'dataclasses': (__spec__.parent, '__module__'), |
224 | 224 | # functional validators |
225 | | - 'field_validator': (__package__, '.functional_validators'), |
226 | | - 'model_validator': (__package__, '.functional_validators'), |
227 | | - 'AfterValidator': (__package__, '.functional_validators'), |
228 | | - 'BeforeValidator': (__package__, '.functional_validators'), |
229 | | - 'PlainValidator': (__package__, '.functional_validators'), |
230 | | - 'WrapValidator': (__package__, '.functional_validators'), |
231 | | - 'SkipValidation': (__package__, '.functional_validators'), |
232 | | - 'InstanceOf': (__package__, '.functional_validators'), |
| 225 | + 'field_validator': (__spec__.parent, '.functional_validators'), |
| 226 | + 'model_validator': (__spec__.parent, '.functional_validators'), |
| 227 | + 'AfterValidator': (__spec__.parent, '.functional_validators'), |
| 228 | + 'BeforeValidator': (__spec__.parent, '.functional_validators'), |
| 229 | + 'PlainValidator': (__spec__.parent, '.functional_validators'), |
| 230 | + 'WrapValidator': (__spec__.parent, '.functional_validators'), |
| 231 | + 'SkipValidation': (__spec__.parent, '.functional_validators'), |
| 232 | + 'InstanceOf': (__spec__.parent, '.functional_validators'), |
233 | 233 | # JSON Schema |
234 | | - 'WithJsonSchema': (__package__, '.json_schema'), |
| 234 | + 'WithJsonSchema': (__spec__.parent, '.json_schema'), |
235 | 235 | # functional serializers |
236 | | - 'field_serializer': (__package__, '.functional_serializers'), |
237 | | - 'model_serializer': (__package__, '.functional_serializers'), |
238 | | - 'PlainSerializer': (__package__, '.functional_serializers'), |
239 | | - 'SerializeAsAny': (__package__, '.functional_serializers'), |
240 | | - 'WrapSerializer': (__package__, '.functional_serializers'), |
| 236 | + 'field_serializer': (__spec__.parent, '.functional_serializers'), |
| 237 | + 'model_serializer': (__spec__.parent, '.functional_serializers'), |
| 238 | + 'PlainSerializer': (__spec__.parent, '.functional_serializers'), |
| 239 | + 'SerializeAsAny': (__spec__.parent, '.functional_serializers'), |
| 240 | + 'WrapSerializer': (__spec__.parent, '.functional_serializers'), |
241 | 241 | # config |
242 | | - 'ConfigDict': (__package__, '.config'), |
243 | | - 'with_config': (__package__, '.config'), |
| 242 | + 'ConfigDict': (__spec__.parent, '.config'), |
| 243 | + 'with_config': (__spec__.parent, '.config'), |
244 | 244 | # validate call |
245 | | - 'validate_call': (__package__, '.validate_call_decorator'), |
| 245 | + 'validate_call': (__spec__.parent, '.validate_call_decorator'), |
246 | 246 | # errors |
247 | | - 'PydanticErrorCodes': (__package__, '.errors'), |
248 | | - 'PydanticUserError': (__package__, '.errors'), |
249 | | - 'PydanticSchemaGenerationError': (__package__, '.errors'), |
250 | | - 'PydanticImportError': (__package__, '.errors'), |
251 | | - 'PydanticUndefinedAnnotation': (__package__, '.errors'), |
252 | | - 'PydanticInvalidForJsonSchema': (__package__, '.errors'), |
| 247 | + 'PydanticErrorCodes': (__spec__.parent, '.errors'), |
| 248 | + 'PydanticUserError': (__spec__.parent, '.errors'), |
| 249 | + 'PydanticSchemaGenerationError': (__spec__.parent, '.errors'), |
| 250 | + 'PydanticImportError': (__spec__.parent, '.errors'), |
| 251 | + 'PydanticUndefinedAnnotation': (__spec__.parent, '.errors'), |
| 252 | + 'PydanticInvalidForJsonSchema': (__spec__.parent, '.errors'), |
253 | 253 | # fields |
254 | | - 'Field': (__package__, '.fields'), |
255 | | - 'computed_field': (__package__, '.fields'), |
256 | | - 'PrivateAttr': (__package__, '.fields'), |
| 254 | + 'Field': (__spec__.parent, '.fields'), |
| 255 | + 'computed_field': (__spec__.parent, '.fields'), |
| 256 | + 'PrivateAttr': (__spec__.parent, '.fields'), |
257 | 257 | # alias |
258 | | - 'AliasChoices': (__package__, '.aliases'), |
259 | | - 'AliasGenerator': (__package__, '.aliases'), |
260 | | - 'AliasPath': (__package__, '.aliases'), |
| 258 | + 'AliasChoices': (__spec__.parent, '.aliases'), |
| 259 | + 'AliasGenerator': (__spec__.parent, '.aliases'), |
| 260 | + 'AliasPath': (__spec__.parent, '.aliases'), |
261 | 261 | # main |
262 | | - 'BaseModel': (__package__, '.main'), |
263 | | - 'create_model': (__package__, '.main'), |
| 262 | + 'BaseModel': (__spec__.parent, '.main'), |
| 263 | + 'create_model': (__spec__.parent, '.main'), |
264 | 264 | # network |
265 | | - 'AnyUrl': (__package__, '.networks'), |
266 | | - 'AnyHttpUrl': (__package__, '.networks'), |
267 | | - 'FileUrl': (__package__, '.networks'), |
268 | | - 'HttpUrl': (__package__, '.networks'), |
269 | | - 'FtpUrl': (__package__, '.networks'), |
270 | | - 'WebsocketUrl': (__package__, '.networks'), |
271 | | - 'AnyWebsocketUrl': (__package__, '.networks'), |
272 | | - 'UrlConstraints': (__package__, '.networks'), |
273 | | - 'EmailStr': (__package__, '.networks'), |
274 | | - 'NameEmail': (__package__, '.networks'), |
275 | | - 'IPvAnyAddress': (__package__, '.networks'), |
276 | | - 'IPvAnyInterface': (__package__, '.networks'), |
277 | | - 'IPvAnyNetwork': (__package__, '.networks'), |
278 | | - 'PostgresDsn': (__package__, '.networks'), |
279 | | - 'CockroachDsn': (__package__, '.networks'), |
280 | | - 'AmqpDsn': (__package__, '.networks'), |
281 | | - 'RedisDsn': (__package__, '.networks'), |
282 | | - 'MongoDsn': (__package__, '.networks'), |
283 | | - 'KafkaDsn': (__package__, '.networks'), |
284 | | - 'NatsDsn': (__package__, '.networks'), |
285 | | - 'MySQLDsn': (__package__, '.networks'), |
286 | | - 'MariaDBDsn': (__package__, '.networks'), |
287 | | - 'ClickHouseDsn': (__package__, '.networks'), |
288 | | - 'validate_email': (__package__, '.networks'), |
| 265 | + 'AnyUrl': (__spec__.parent, '.networks'), |
| 266 | + 'AnyHttpUrl': (__spec__.parent, '.networks'), |
| 267 | + 'FileUrl': (__spec__.parent, '.networks'), |
| 268 | + 'HttpUrl': (__spec__.parent, '.networks'), |
| 269 | + 'FtpUrl': (__spec__.parent, '.networks'), |
| 270 | + 'WebsocketUrl': (__spec__.parent, '.networks'), |
| 271 | + 'AnyWebsocketUrl': (__spec__.parent, '.networks'), |
| 272 | + 'UrlConstraints': (__spec__.parent, '.networks'), |
| 273 | + 'EmailStr': (__spec__.parent, '.networks'), |
| 274 | + 'NameEmail': (__spec__.parent, '.networks'), |
| 275 | + 'IPvAnyAddress': (__spec__.parent, '.networks'), |
| 276 | + 'IPvAnyInterface': (__spec__.parent, '.networks'), |
| 277 | + 'IPvAnyNetwork': (__spec__.parent, '.networks'), |
| 278 | + 'PostgresDsn': (__spec__.parent, '.networks'), |
| 279 | + 'CockroachDsn': (__spec__.parent, '.networks'), |
| 280 | + 'AmqpDsn': (__spec__.parent, '.networks'), |
| 281 | + 'RedisDsn': (__spec__.parent, '.networks'), |
| 282 | + 'MongoDsn': (__spec__.parent, '.networks'), |
| 283 | + 'KafkaDsn': (__spec__.parent, '.networks'), |
| 284 | + 'NatsDsn': (__spec__.parent, '.networks'), |
| 285 | + 'MySQLDsn': (__spec__.parent, '.networks'), |
| 286 | + 'MariaDBDsn': (__spec__.parent, '.networks'), |
| 287 | + 'ClickHouseDsn': (__spec__.parent, '.networks'), |
| 288 | + 'validate_email': (__spec__.parent, '.networks'), |
289 | 289 | # root_model |
290 | | - 'RootModel': (__package__, '.root_model'), |
| 290 | + 'RootModel': (__spec__.parent, '.root_model'), |
291 | 291 | # types |
292 | | - 'Strict': (__package__, '.types'), |
293 | | - 'StrictStr': (__package__, '.types'), |
294 | | - 'conbytes': (__package__, '.types'), |
295 | | - 'conlist': (__package__, '.types'), |
296 | | - 'conset': (__package__, '.types'), |
297 | | - 'confrozenset': (__package__, '.types'), |
298 | | - 'constr': (__package__, '.types'), |
299 | | - 'StringConstraints': (__package__, '.types'), |
300 | | - 'ImportString': (__package__, '.types'), |
301 | | - 'conint': (__package__, '.types'), |
302 | | - 'PositiveInt': (__package__, '.types'), |
303 | | - 'NegativeInt': (__package__, '.types'), |
304 | | - 'NonNegativeInt': (__package__, '.types'), |
305 | | - 'NonPositiveInt': (__package__, '.types'), |
306 | | - 'confloat': (__package__, '.types'), |
307 | | - 'PositiveFloat': (__package__, '.types'), |
308 | | - 'NegativeFloat': (__package__, '.types'), |
309 | | - 'NonNegativeFloat': (__package__, '.types'), |
310 | | - 'NonPositiveFloat': (__package__, '.types'), |
311 | | - 'FiniteFloat': (__package__, '.types'), |
312 | | - 'condecimal': (__package__, '.types'), |
313 | | - 'condate': (__package__, '.types'), |
314 | | - 'UUID1': (__package__, '.types'), |
315 | | - 'UUID3': (__package__, '.types'), |
316 | | - 'UUID4': (__package__, '.types'), |
317 | | - 'UUID5': (__package__, '.types'), |
318 | | - 'FilePath': (__package__, '.types'), |
319 | | - 'DirectoryPath': (__package__, '.types'), |
320 | | - 'NewPath': (__package__, '.types'), |
321 | | - 'Json': (__package__, '.types'), |
322 | | - 'Secret': (__package__, '.types'), |
323 | | - 'SecretStr': (__package__, '.types'), |
324 | | - 'SecretBytes': (__package__, '.types'), |
325 | | - 'StrictBool': (__package__, '.types'), |
326 | | - 'StrictBytes': (__package__, '.types'), |
327 | | - 'StrictInt': (__package__, '.types'), |
328 | | - 'StrictFloat': (__package__, '.types'), |
329 | | - 'PaymentCardNumber': (__package__, '.types'), |
330 | | - 'ByteSize': (__package__, '.types'), |
331 | | - 'PastDate': (__package__, '.types'), |
332 | | - 'FutureDate': (__package__, '.types'), |
333 | | - 'PastDatetime': (__package__, '.types'), |
334 | | - 'FutureDatetime': (__package__, '.types'), |
335 | | - 'AwareDatetime': (__package__, '.types'), |
336 | | - 'NaiveDatetime': (__package__, '.types'), |
337 | | - 'AllowInfNan': (__package__, '.types'), |
338 | | - 'EncoderProtocol': (__package__, '.types'), |
339 | | - 'EncodedBytes': (__package__, '.types'), |
340 | | - 'EncodedStr': (__package__, '.types'), |
341 | | - 'Base64Encoder': (__package__, '.types'), |
342 | | - 'Base64Bytes': (__package__, '.types'), |
343 | | - 'Base64Str': (__package__, '.types'), |
344 | | - 'Base64UrlBytes': (__package__, '.types'), |
345 | | - 'Base64UrlStr': (__package__, '.types'), |
346 | | - 'GetPydanticSchema': (__package__, '.types'), |
347 | | - 'Tag': (__package__, '.types'), |
348 | | - 'Discriminator': (__package__, '.types'), |
349 | | - 'JsonValue': (__package__, '.types'), |
350 | | - 'OnErrorOmit': (__package__, '.types'), |
| 292 | + 'Strict': (__spec__.parent, '.types'), |
| 293 | + 'StrictStr': (__spec__.parent, '.types'), |
| 294 | + 'conbytes': (__spec__.parent, '.types'), |
| 295 | + 'conlist': (__spec__.parent, '.types'), |
| 296 | + 'conset': (__spec__.parent, '.types'), |
| 297 | + 'confrozenset': (__spec__.parent, '.types'), |
| 298 | + 'constr': (__spec__.parent, '.types'), |
| 299 | + 'StringConstraints': (__spec__.parent, '.types'), |
| 300 | + 'ImportString': (__spec__.parent, '.types'), |
| 301 | + 'conint': (__spec__.parent, '.types'), |
| 302 | + 'PositiveInt': (__spec__.parent, '.types'), |
| 303 | + 'NegativeInt': (__spec__.parent, '.types'), |
| 304 | + 'NonNegativeInt': (__spec__.parent, '.types'), |
| 305 | + 'NonPositiveInt': (__spec__.parent, '.types'), |
| 306 | + 'confloat': (__spec__.parent, '.types'), |
| 307 | + 'PositiveFloat': (__spec__.parent, '.types'), |
| 308 | + 'NegativeFloat': (__spec__.parent, '.types'), |
| 309 | + 'NonNegativeFloat': (__spec__.parent, '.types'), |
| 310 | + 'NonPositiveFloat': (__spec__.parent, '.types'), |
| 311 | + 'FiniteFloat': (__spec__.parent, '.types'), |
| 312 | + 'condecimal': (__spec__.parent, '.types'), |
| 313 | + 'condate': (__spec__.parent, '.types'), |
| 314 | + 'UUID1': (__spec__.parent, '.types'), |
| 315 | + 'UUID3': (__spec__.parent, '.types'), |
| 316 | + 'UUID4': (__spec__.parent, '.types'), |
| 317 | + 'UUID5': (__spec__.parent, '.types'), |
| 318 | + 'FilePath': (__spec__.parent, '.types'), |
| 319 | + 'DirectoryPath': (__spec__.parent, '.types'), |
| 320 | + 'NewPath': (__spec__.parent, '.types'), |
| 321 | + 'Json': (__spec__.parent, '.types'), |
| 322 | + 'Secret': (__spec__.parent, '.types'), |
| 323 | + 'SecretStr': (__spec__.parent, '.types'), |
| 324 | + 'SecretBytes': (__spec__.parent, '.types'), |
| 325 | + 'StrictBool': (__spec__.parent, '.types'), |
| 326 | + 'StrictBytes': (__spec__.parent, '.types'), |
| 327 | + 'StrictInt': (__spec__.parent, '.types'), |
| 328 | + 'StrictFloat': (__spec__.parent, '.types'), |
| 329 | + 'PaymentCardNumber': (__spec__.parent, '.types'), |
| 330 | + 'ByteSize': (__spec__.parent, '.types'), |
| 331 | + 'PastDate': (__spec__.parent, '.types'), |
| 332 | + 'FutureDate': (__spec__.parent, '.types'), |
| 333 | + 'PastDatetime': (__spec__.parent, '.types'), |
| 334 | + 'FutureDatetime': (__spec__.parent, '.types'), |
| 335 | + 'AwareDatetime': (__spec__.parent, '.types'), |
| 336 | + 'NaiveDatetime': (__spec__.parent, '.types'), |
| 337 | + 'AllowInfNan': (__spec__.parent, '.types'), |
| 338 | + 'EncoderProtocol': (__spec__.parent, '.types'), |
| 339 | + 'EncodedBytes': (__spec__.parent, '.types'), |
| 340 | + 'EncodedStr': (__spec__.parent, '.types'), |
| 341 | + 'Base64Encoder': (__spec__.parent, '.types'), |
| 342 | + 'Base64Bytes': (__spec__.parent, '.types'), |
| 343 | + 'Base64Str': (__spec__.parent, '.types'), |
| 344 | + 'Base64UrlBytes': (__spec__.parent, '.types'), |
| 345 | + 'Base64UrlStr': (__spec__.parent, '.types'), |
| 346 | + 'GetPydanticSchema': (__spec__.parent, '.types'), |
| 347 | + 'Tag': (__spec__.parent, '.types'), |
| 348 | + 'Discriminator': (__spec__.parent, '.types'), |
| 349 | + 'JsonValue': (__spec__.parent, '.types'), |
| 350 | + 'OnErrorOmit': (__spec__.parent, '.types'), |
351 | 351 | # type_adapter |
352 | | - 'TypeAdapter': (__package__, '.type_adapter'), |
| 352 | + 'TypeAdapter': (__spec__.parent, '.type_adapter'), |
353 | 353 | # warnings |
354 | | - 'PydanticDeprecatedSince20': (__package__, '.warnings'), |
355 | | - 'PydanticDeprecatedSince26': (__package__, '.warnings'), |
356 | | - 'PydanticDeprecationWarning': (__package__, '.warnings'), |
| 354 | + 'PydanticDeprecatedSince20': (__spec__.parent, '.warnings'), |
| 355 | + 'PydanticDeprecatedSince26': (__spec__.parent, '.warnings'), |
| 356 | + 'PydanticDeprecationWarning': (__spec__.parent, '.warnings'), |
357 | 357 | # annotated handlers |
358 | | - 'GetCoreSchemaHandler': (__package__, '.annotated_handlers'), |
359 | | - 'GetJsonSchemaHandler': (__package__, '.annotated_handlers'), |
| 358 | + 'GetCoreSchemaHandler': (__spec__.parent, '.annotated_handlers'), |
| 359 | + 'GetJsonSchemaHandler': (__spec__.parent, '.annotated_handlers'), |
360 | 360 | # generate schema from ._internal |
361 | | - 'GenerateSchema': (__package__, '._internal._generate_schema'), |
| 361 | + 'GenerateSchema': (__spec__.parent, '._internal._generate_schema'), |
362 | 362 | # pydantic_core stuff |
363 | 363 | 'ValidationError': ('pydantic_core', '.'), |
364 | 364 | 'ValidationInfo': ('pydantic_core', '.core_schema'), |
|
367 | 367 | 'FieldSerializationInfo': ('pydantic_core', '.core_schema'), |
368 | 368 | 'SerializerFunctionWrapHandler': ('pydantic_core', '.core_schema'), |
369 | 369 | # deprecated, mostly not included in __all__ |
370 | | - 'root_validator': (__package__, '.deprecated.class_validators'), |
371 | | - 'validator': (__package__, '.deprecated.class_validators'), |
372 | | - 'BaseConfig': (__package__, '.deprecated.config'), |
373 | | - 'Extra': (__package__, '.deprecated.config'), |
374 | | - 'parse_obj_as': (__package__, '.deprecated.tools'), |
375 | | - 'schema_of': (__package__, '.deprecated.tools'), |
376 | | - 'schema_json_of': (__package__, '.deprecated.tools'), |
| 370 | + 'root_validator': (__spec__.parent, '.deprecated.class_validators'), |
| 371 | + 'validator': (__spec__.parent, '.deprecated.class_validators'), |
| 372 | + 'BaseConfig': (__spec__.parent, '.deprecated.config'), |
| 373 | + 'Extra': (__spec__.parent, '.deprecated.config'), |
| 374 | + 'parse_obj_as': (__spec__.parent, '.deprecated.tools'), |
| 375 | + 'schema_of': (__spec__.parent, '.deprecated.tools'), |
| 376 | + 'schema_json_of': (__spec__.parent, '.deprecated.tools'), |
377 | 377 | 'FieldValidationInfo': ('pydantic_core', '.core_schema'), |
378 | 378 | } |
379 | 379 |
|
|
0 commit comments