|
37 | 37 | from __future__ import annotations |
38 | 38 | from typing import Dict, Any, Callable, cast |
39 | 39 | from dataclasses import dataclass |
40 | | -from pkg_resources import iter_entry_points |
| 40 | +from importlib.metadata import entry_points |
41 | 41 | from google.protobuf.message import Message as ProtoMessage |
42 | 42 | from google.protobuf.descriptor import EnumDescriptor |
43 | 43 | from google.protobuf.struct_pb2 import Struct as StructProto # pylint: disable=[E0611] |
|
46 | 46 | from .types import Distinct |
47 | 47 | from .collections import Registry |
48 | 48 |
|
| 49 | +#: Name of well-known EMPTY protobuf message (for use with `.create_message()`) |
49 | 50 | PROTO_EMPTY = 'google.protobuf.Empty' |
| 51 | +#: Name of well-known ANY protobuf message (for use with `.create_message()`) |
50 | 52 | PROTO_ANY = 'google.protobuf.Any' |
| 53 | +#: Name of well-known DURATION protobuf message (for use with `.create_message()`) |
51 | 54 | PROTO_DURATION = 'google.protobuf.Duration' |
| 55 | +#: Name of well-known TIMESTAMP protobuf message (for use with `.create_message()`) |
52 | 56 | PROTO_TIMESTAMP = 'google.protobuf.Timestamp' |
| 57 | +#: Name of well-known STRUCT protobuf message (for use with `.create_message()`) |
53 | 58 | PROTO_STRUCT = 'google.protobuf.Struct' |
| 59 | +#: Name of well-known VALUE protobuf message (for use with `.create_message()`) |
54 | 60 | PROTO_VALUE = 'google.protobuf.Value' |
| 61 | +#: Name of well-known LISTVALUE protobuf message (for use with `.create_message()`) |
55 | 62 | PROTO_LISTVALUE = 'google.protobuf.ListValue' |
| 63 | +#: Name of well-known FIELDMASK protobuf message (for use with `.create_message()`) |
56 | 64 | PROTO_FIELDMASK = 'google.protobuf.FieldMask' |
57 | 65 |
|
58 | 66 | # Classes |
@@ -229,7 +237,7 @@ def load_registered(group: str) -> None: # pragma: no cover |
229 | 237 |
|
230 | 238 | load_registered('firebird.base.protobuf') |
231 | 239 | """ |
232 | | - for desc in (entry.load() for entry in iter_entry_points(group)): |
| 240 | + for desc in (entry.load() for entry in entry_points().get(group, [])): |
233 | 241 | register_decriptor(desc) |
234 | 242 |
|
235 | 243 |
|
|
0 commit comments