File python-prometrix.spec of Package python-prometrix

#
# spec file for package python-prometrix
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define commit_hash d58f5d4b8e568194f888bdef8b9818d4e151fd31

%{?sle15_python_module_pythons}
Name:           python-prometrix
Version:        0.2.5
Release:        0
Summary:        A Python Prometheus client for all Prometheus instances
License:        MIT
URL:            https://github.com/robusta-dev/prometrix
Source:         https://github.com/robusta-dev/prometrix/archive/%{commit_hash}.tar.gz#/prometrix-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module poetry-core}
BuildRequires:  %{python_module wheel}
# START Build Requirements
BuildRequires:  %{python_module boto3 >= 1.28.15}
BuildRequires:  %{python_module botocore >= 1.13.15}
BuildRequires:  %{python_module pydantic >= 1.8.1}
BuildRequires:  %{python_module prometheus-api-client >= 0.5.3}
# END Build Requirements
# SECTION test requirements
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module PyYAML}
BuildRequires:  %{python_module numpy}
BuildRequires:  %{python_module pandas}
# /SECTION
BuildRequires:  fdupes
Requires:       python3-boto3 >= 1.28.15
Requires:       python3-botocore >= 1.13.15
Requires:       python3-pydantic >= 1.8.1
Requires:       python3-prometheus-api-client >= 0.5.3
BuildArch:      noarch
%python_subpackages

%description
Prometrix - Unified Prometheus Client

This Python package provides a unified Prometheus client that can be used to
connect to and query various types of Prometheus instances. The package is
based on the
[prometheus-api-client](https://pypi.org/project/prometheus-api-client/)
package, which serves as the foundation for our extended functionality.

The prometrix package enhances the prometheus-api-client by adding
vendor-specific authentication methods and other features to handle
authorization and signatures for all supported clients. This ensures a secure
and seamless connection to the various types of Prometheus instances.

1.  Coralogix
2.  GKE (Google Kubernetes Engine)
3.  Azure
4.  EKS (Amazon Elastic Kubernetes Service)
5.  Thanos
6.  Victoria Metrics

%prep
%autosetup -p1 -n prometrix-%{commit_hash}
# https://github.com/robusta-dev/prometrix/issues/30
sed -i '/description/a name = "prometrix"' pyproject.toml
sed -i '/description/a [project]' pyproject.toml
sed -i '/description/{G;}' pyproject.toml

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
# checks disabled, see upstream issue:
# https://github.com/robusta-dev/prometrix/issues/9
# DISABLED%DISABLED pytest tests/main.py

%files %{python_files}
%doc README.md
%license LICENSE.md
%{python_sitelib}/prometrix
%{python_sitelib}/prometrix-*.dist-info

%changelog
openSUSE Build Service is sponsored by