Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prometheus_api_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A collection of tools to collect and manipulate prometheus metrics."""

__title__ = "prometheus-connect"
__title__ = "prometheus-api-client-optional-matplotlib"
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The __title__ should remain as prometheus-api-client (or the original value prometheus-connect if that was intentional). Changing it to prometheus-api-client-optional-matplotlib is inconsistent with standard Python packaging practices for optional dependencies. The package title typically doesn't reflect which dependencies are optional.

Suggested change
__title__ = "prometheus-api-client-optional-matplotlib"
__title__ = "prometheus-api-client"

Copilot uses AI. Check for mistakes.
__version__ = "0.6.0"

from .prometheus_connect import * # noqa F403
Expand Down
5 changes: 4 additions & 1 deletion prometheus_api_client/metric_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def __init__(self, *args, **kwargs):

register_matplotlib_converters()
except ImportError as exce: # noqa F841
raise ImportError("matplotlib was not found")
raise ImportError(
"matplotlib is required for plotting functionality. "
"Install with: pip install 'prometheus-api-client[plotting]'"
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message references prometheus-api-client[plotting] but the package name in setup.py has been changed to prometheus-api-client-optional-matplotlib. This creates an inconsistency.

If you intend to publish this as a different package, the installation instruction should be updated to match. However, it would be better to keep the original package name and use extras_require to make matplotlib optional, allowing users to install with pip install prometheus-api-client[plotting] as the error message suggests.

Suggested change
"Install with: pip install 'prometheus-api-client[plotting]'"
"Install with: pip install 'prometheus-api-client-optional-matplotlib'"

Copilot uses AI. Check for mistakes.
)

# One graph with potentially N lines - if plot() is called twice
self._plt = plt
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ requests
dateparser
pandas>=1.4.0
numpy
matplotlib
httmock
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def get_version():

VERSION = get_version()
setuptools.setup(
name="prometheus-api-client",
name="prometheus-api-client-optional-matplotlib",
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package name change from prometheus-api-client to prometheus-api-client-optional-matplotlib is inconsistent with the typical approach for making dependencies optional. The standard Python packaging practice is to keep the package name the same and use extras_require in setup.py to provide optional features.

Changing the package name creates a fork of the project rather than making matplotlib optional in the existing package. Consider keeping the original name prometheus-api-client and using extras_require={'plotting': ['matplotlib']} in setup.py instead.

Copilot uses AI. Check for mistakes.
version=VERSION,
author="Anand Sanmukhani",
author_email="[email protected]",
description="A small python api to collect data from prometheus",
description="A Python API client for Prometheus with optional matplotlib dependency",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/4n4nd/prometheus-api-client-python",
Expand Down