1{
2 lib,
3 boto3,
4 botocore,
5 buildPythonPackage,
6 dateparser,
7 fetchFromGitHub,
8 matplotlib,
9 numpy,
10 pandas,
11 poetry-core,
12 prometheus-api-client,
13 pydantic,
14 requests,
15}:
16
17buildPythonPackage rec {
18 pname = "prometrix";
19 version = "0.1.18-unstable-2024-04-30";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "robusta-dev";
24 repo = "prometrix";
25 # https://github.com/robusta-dev/prometrix/issues/19
26 rev = "35128847d46016b88455e0a98f0eeec08d042107";
27 hash = "sha256-g8ZqgL9ETVwpKLMQS7s7A4GpSGfaFEDLOr8JBvFl2C4=";
28 };
29
30 pythonRelaxDeps = [
31 "pydantic"
32 "urllib3"
33 ];
34
35 build-system = [ poetry-core ];
36
37
38 dependencies = [
39 boto3
40 botocore
41 dateparser
42 matplotlib
43 numpy
44 pandas
45 prometheus-api-client
46 pydantic
47 requests
48 ];
49
50 # Fixture is missing
51 # https://github.com/robusta-dev/prometrix/issues/9
52 doCheck = false;
53
54 pythonImportsCheck = [ "prometrix" ];
55
56 meta = with lib; {
57 description = "Unified Prometheus client";
58 longDescription = ''
59 This Python package provides a unified Prometheus client that can be used
60 to connect to and query various types of Prometheus instances.
61 '';
62 homepage = "https://github.com/robusta-dev/prometrix";
63 license = licenses.mit;
64 maintainers = with maintainers; [ azahi ];
65 # prometheus-api-client 0.5.5 is not working
66 # https://github.com/robusta-dev/prometrix/issues/14
67 broken = versionAtLeast prometheus-api-client.version "0.5.3";
68 };
69}