File python-starlette_exporter.spec of Package python-starlette_exporter

#
# spec file for package python-starlette_exporter
#
# Copyright (c) 2020 SUSE LLC
#
# 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/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global modname starlette_exporter

%define skip_python2 1

Name:           python-%{modname}
Version:        0.14.0
Release:        0
Summary:        Prometheus exporter for Starlette and FastAPI
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://github.com/stephenhillier/starlette_exporter
Source:         https://pypi.io/packages/source/s/%{modname}/%{modname}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  %{python_module base}
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
Requires:       python3-base
Requires:       python-prometheus_client >= 0.7.1
Requires:       python-requests>=0.12.9
Requires:       python-starlette
BuildArch:      noarch
%python_subpackages

%description
This starlette middleware collects basic metrics for Starlette and FastAPI:
- Counter: starlette_requests_total
- Histogram: starlette_request_duration_seconds

%prep
%setup -q -n %{modname}-%{version}

%build
%python_build

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

%check

%files %{python_files}
%doc README.md
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by