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