1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, orjson
5, quantile-python
6, aiohttp
7, aiohttp-basicauth
8, starlette
9, quart
10, pytestCheckHook
11, httpx
12, fastapi
13, uvicorn
14, pythonOlder
15}:
16
17buildPythonPackage rec {
18 pname = "aioprometheus";
19 version = "unstable-2023-03-14";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "claws";
26 repo = "aioprometheus";
27 rev = "4786678b413d166c0b6e0041558d11bc1a7097b2";
28 hash = "sha256-2z68rQkMjYqkszg5Noj9owWUWQGOEp/91RGiWiyZVOY=";
29 };
30
31 propagatedBuildInputs = [
32 orjson
33 quantile-python
34 ];
35
36 passthru.optional-dependencies = {
37 aiohttp = [
38 aiohttp
39 ];
40 starlette = [
41 starlette
42 ];
43 quart = [
44 quart
45 ];
46 };
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 aiohttp-basicauth
51 httpx
52 fastapi
53 uvicorn
54 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
55
56 pythonImportsCheck = [ "aioprometheus" ];
57
58 meta = with lib; {
59 description = "A Prometheus Python client library for asyncio-based applications";
60 homepage = "https://github.com/claws/aioprometheus";
61 changelog = "https://github.com/claws/aioprometheus/blob/${src.rev}/CHANGELOG.md";
62 license = licenses.mit;
63 maintainers = with maintainers; [ mbalatsko ];
64 };
65}