1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 twisted,
7 pytestCheckHook,
8 pythonOlder,
9}:
10
11buildPythonPackage rec {
12 pname = "prometheus-client";
13 version = "0.20.0";
14 pyproject = true;
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "prometheus";
20 repo = "client_python";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-IMw0mpOUzjXBy4bMTeSFMc5pdibI5lGxZHKiufjPLbM=";
23 };
24
25 build-system = [ setuptools ];
26
27 optional-dependencies.twisted = [ twisted ];
28
29 __darwinAllowLocalNetworking = true;
30
31 nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);
32
33 pythonImportsCheck = [ "prometheus_client" ];
34
35 meta = with lib; {
36 description = "Prometheus instrumentation library for Python applications";
37 homepage = "https://github.com/prometheus/client_python";
38 changelog = "https://github.com/prometheus/client_python/releases/tag/v${version}";
39 license = licenses.asl20;
40 maintainers = [ ];
41 };
42}