This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ Fix type errors introduced by new annotations in the Prometheus Client library.
Original file line number Diff line number Diff line change 30
30
Type ,
31
31
TypeVar ,
32
32
Union ,
33
+ cast ,
33
34
)
34
35
35
36
import attr
60
61
HAVE_PROC_SELF_STAT = os .path .exists ("/proc/self/stat" )
61
62
62
63
63
- class RegistryProxy :
64
+ class _RegistryProxy :
64
65
@staticmethod
65
66
def collect () -> Iterable [Metric ]:
66
67
for metric in REGISTRY .collect ():
67
68
if not metric .name .startswith ("__" ):
68
69
yield metric
69
70
70
71
72
+ # A little bit nasty, but collect() above is static so a Protocol doesn't work.
73
+ # _RegistryProxy matches the signature of a CollectorRegistry instance enough
74
+ # for it to be usable in the contexts in which we use it.
75
+ # TODO Do something nicer about this.
76
+ RegistryProxy = cast (CollectorRegistry , _RegistryProxy )
77
+
78
+
71
79
@attr .s (slots = True , hash = True , auto_attribs = True )
72
80
class LaterGauge :
73
81
Original file line number Diff line number Diff line change 76
76
"msgpack>=0.5.2" ,
77
77
"phonenumbers>=8.2.0" ,
78
78
# we use GaugeHistogramMetric, which was added in prom-client 0.4.0.
79
- # 0.13.0 has an incorrect type annotation, see #11832.
80
- "prometheus_client>=0.4.0,<0.13.0" ,
79
+ "prometheus_client>=0.4.0" ,
81
80
# we use `order`, which arrived in attrs 19.2.0.
82
81
# Note: 21.1.0 broke `/sync`, see #9936
83
82
"attrs>=19.2.0,!=21.1.0" ,
You can’t perform that action at this time.
0 commit comments