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 3030 Type ,
3131 TypeVar ,
3232 Union ,
33+ cast ,
3334)
3435
3536import attr
6061HAVE_PROC_SELF_STAT = os .path .exists ("/proc/self/stat" )
6162
6263
63- class RegistryProxy :
64+ class _RegistryProxy :
6465 @staticmethod
6566 def collect () -> Iterable [Metric ]:
6667 for metric in REGISTRY .collect ():
6768 if not metric .name .startswith ("__" ):
6869 yield metric
6970
7071
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+
7179@attr .s (slots = True , hash = True , auto_attribs = True )
7280class LaterGauge :
7381
Original file line number Diff line number Diff line change 7676 "msgpack>=0.5.2" ,
7777 "phonenumbers>=8.2.0" ,
7878 # 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" ,
8180 # we use `order`, which arrived in attrs 19.2.0.
8281 # Note: 21.1.0 broke `/sync`, see #9936
8382 "attrs>=19.2.0,!=21.1.0" ,
You can’t perform that action at this time.
0 commit comments