8000 Add missing functions/classes to __all__ (#757) · Cameron-Calpin/client_python@b3271a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit b3271a3

Browse files
authored
Add missing functions/classes to __all__ (prometheus#757)
* Add CollectorRegistry&REGISTRY to __init__.py * Set implicit_reexport to False * Add functions/classes to __all__ * Add __all__ to exposition.py prometheus_client/__init__.py:7: error: Module "prometheus_client.exposition" does not explicitly export attribute "make_asgi_app"; implicit reexport disabled Signed-off-by: Yury Pliner <yury.pliner@gmail.com>
1 parent 304745f commit b3271a3

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[mypy]
22
exclude = prometheus_client/decorator.py|prometheus_client/twisted|tests/test_twisted.py
3+
implicit_reexport = False
34

45
[mypy-prometheus_client.decorator]
56
follow_imports = skip

prometheus_client/__init__.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,35 @@
1717
from .process_collector import PROCESS_COLLECTOR, ProcessCollector
1818
from .registry import CollectorRegistry, REGISTRY
1919

20-
__all__ = ['Counter', 'Gauge', 'Summary', 'Histogram', 'Info', 'Enum']
21-
20+
__all__ = (
21+
'CollectorRegistry',
22+
'REGISTRY',
23+
'Metric',
24+
'Counter',
25+
'Gauge',
26+
'Summary',
27+
'Histogram',
28+
'Info',
29+
'Enum',
30+
'CONTENT_TYPE_LATEST',
31+
'generate_latest',
32+
'MetricsHandler',
33+
'make_wsgi_app',
34+
'make_asgi_app',
35+
'start_http_server',
36+
'start_wsgi_server',
37+
'write_to_textfile',
38+
'push_to_gateway',
39+
'pushadd_to_gateway',
40+
'delete_from_gateway',
41+
'instance_ip_grouping_key',
42+
'ProcessCollector',
43+
'PROCESS_COLLECTOR',
44+
'PlatformCollector',
45+
'PLATFORM_COLLECTOR',
46+
'GCCollector',
47+
'GC_COLLECTOR',
48+
)
2249

2350
if __name__ == '__main__':
2451
c = Counter('cc', 'A counter')

prometheus_client/exposition.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
from .registry import REGISTRY
1818
from .utils import floatToGoString
1919

20+
__all__ = (
21+
'CONTENT_TYPE_LATEST',
22+
'delete_from_gateway',
23+
'generate_latest',
24+
'instance_ip_grouping_key',
25+
'make_asgi_app',
26+
'make_wsgi_app',
27+
'MetricsHandler',
28+
'push_to_gateway',
29+
'pushadd_to_gateway',
30+
'start_http_server',
31+
'start_wsgi_server',
32+
'write_to_textfile',
33+
)
34+
2035
CONTENT_TYPE_LATEST = 'text/plain; version=0.0.4; charset=utf-8'
2136
"""Content type of the latest text format"""
2237
PYTHON376_OR_NEWER = sys.version_info > (3, 7, 5)

0 commit comments

Comments
 (0)
0