Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to imports to fix go-to-declaration in editors #747

Merged
merged 3 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 12 additions & 31 deletions prometheus_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,21 @@
exposition, gc_collector, metrics, metrics_core, platform_collector,
process_collector, registry,
csmarchbanks marked this conversation as resolved.
Show resolved Hide resolved
)
from .exposition import (
CONTENT_TYPE_LATEST, delete_from_gateway, generate_latest,
instance_ip_grouping_key, make_asgi_app, make_wsgi_app, MetricsHandler,
push_to_gateway, pushadd_to_gateway, start_http_server, start_wsgi_server,
write_to_textfile,
)
from .gc_collector import GC_COLLECTOR, GCCollector
from .metrics import Counter, Enum, Gauge, Histogram, Info, Summary
from .metrics_core import Metric
from .platform_collector import PLATFORM_COLLECTOR, PlatformCollector
from .process_collector import PROCESS_COLLECTOR, ProcessCollector
from .registry import CollectorRegistry, REGISTRY

__all__ = ['Counter', 'Gauge', 'Summary', 'Histogram', 'Info', 'Enum']

CollectorRegistry = registry.CollectorRegistry
REGISTRY = registry.REGISTRY
Metric = metrics_core.Metric
Counter = metrics.Counter
Gauge = metrics.Gauge
Summary = metrics.Summary
Histogram = metrics.Histogram
Info = metrics.Info
Enum = metrics.Enum

CONTENT_TYPE_LATEST = exposition.CONTENT_TYPE_LATEST
generate_latest = exposition.generate_latest
MetricsHandler = exposition.MetricsHandler
make_wsgi_app = exposition.make_wsgi_app
make_asgi_app = exposition.make_asgi_app
start_http_server = exposition.start_http_server
start_wsgi_server = exposition.start_wsgi_server
write_to_textfile = exposition.write_to_textfile
push_to_gateway = exposition.push_to_gateway
pushadd_to_gateway = exposition.pushadd_to_gateway
delete_from_gateway = exposition.delete_from_gateway
instance_ip_grouping_key = exposition.instance_ip_grouping_key

ProcessCollector = process_collector.ProcessCollector
PROCESS_COLLECTOR = process_collector.PROCESS_COLLECTOR

PlatformCollector = platform_collector.PlatformCollector
PLATFORM_COLLECTOR = platform_collector.PLATFORM_COLLECTOR

GCCollector = gc_collector.GCCollector
GC_COLLECTOR = gc_collector.GC_COLLECTOR

if __name__ == '__main__':
c = Counter('cc', 'A counter')
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ignore =
E129,
E731

per-file-ignores = prometheus_client/__init__.py:F401
import-order-style = google
application-import-names = prometheus_client

Expand Down