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