1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 pytestCheckHook,
7 devtools,
8 fastapi,
9 httpx,
10 poetry-core,
11 prometheus-client,
12 requests,
13 starlette,
14}:
15
16buildPythonPackage rec {
17 pname = "prometheus-fastapi-instrumentator";
18 version = "7.0.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.9";
22
23 src = fetchFromGitHub {
24 owner = "trallnag";
25 repo = "prometheus-fastapi-instrumentator";
26 rev = "refs/tags/v${version}";
27 hash = "sha256-yvKdhQdbY0+jEc8TEHNNgtdnqE0abnd4MN/JZFQwQ2E=";
28 };
29
30 build-system = [
31 poetry-core
32 ];
33
34 dependencies = [
35 prometheus-client
36 starlette
37 ];
38
39 nativeCheckInputs = [
40 devtools
41 fastapi
42 httpx
43 pytestCheckHook
44 requests
45 ];
46
47 pythonImportsCheck = [ "prometheus_fastapi_instrumentator" ];
48
49 meta = {
50 description = "Instrument FastAPI with Prometheus metrics";
51 homepage = "https://github.com/trallnag/prometheus-fastapi-instrumentator";
52 changelog = "https://github.com/trallnag/prometheus-fastapi-instrumentator/blob/${src.rev}/CHANGELOG.md";
53 license = with lib.licenses; [
54 isc
55 bsd3
56 ];
57 maintainers = with lib.maintainers; [ bcdarwin ];
58 platforms = lib.platforms.linux; # numerous test failures on Darwin
59 };
60}