Skip to content

Commit 600cd36

Browse files
committed
make matplotlib optional
1 parent 274743a commit 600cd36

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

prometheus_api_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""A collection of tools to collect and manipulate prometheus metrics."""
22

3-
__title__ = "prometheus-connect"
3+
__title__ = "prometheus-api-client-optional-matplotlib"
44
__version__ = "0.6.0"
55

66
from .prometheus_connect import * # noqa F403

prometheus_api_client/metric_plot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def __init__(self, *args, **kwargs):
2222

2323
register_matplotlib_converters()
2424
except ImportError as exce: # noqa F841
25-
raise ImportError("matplotlib was not found")
25+
raise ImportError(
26+
"matplotlib is required for plotting functionality. "
27+
"Install with: pip install 'prometheus-api-client[plotting]'"
28+
)
2629

2730
# One graph with potentially N lines - if plot() is called twice
2831
self._plt = plt

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ requests
22
dateparser
33
pandas>=1.4.0
44
numpy
5-
matplotlib
65
httmock

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ def get_version():
2727

2828
VERSION = get_version()
2929
setuptools.setup(
30-
name="prometheus-api-client",
30+
name="prometheus-api-client-optional-matplotlib",
3131
version=VERSION,
3232
author="Anand Sanmukhani",
3333
author_email="asanmukhani@microsoft.com",
34-
description="A small python api to collect data from prometheus",
34+
description="A Python API client for Prometheus with optional matplotlib dependency",
3535
long_description=long_description,
3636
long_description_content_type="text/markdown",
3737
url="https://github.com/4n4nd/prometheus-api-client-python",

0 commit comments

Comments
 (0)