nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
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.1.0";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "trallnag";
23 repo = "prometheus-fastapi-instrumentator";
24 tag = "v${version}";
25 hash = "sha256-54h/kwIdzFzxdYglwcEBPkLYno1YH2iWklg35qY2b00=";
26 };
27
28 build-system = [
29 poetry-core
30 ];
31
32 dependencies = [
33 prometheus-client
34 starlette
35 ];
36
37 nativeCheckInputs = [
38 devtools
39 fastapi
40 httpx
41 pytestCheckHook
42 requests
43 ];
44
45 # numerous test failures on Darwin
46 doCheck = stdenv.hostPlatform.isLinux;
47
48 pythonImportsCheck = [ "prometheus_fastapi_instrumentator" ];
49
50 meta = {
51 description = "Instrument FastAPI with Prometheus metrics";
52 homepage = "https://github.com/trallnag/prometheus-fastapi-instrumentator";
53 changelog = "https://github.com/trallnag/prometheus-fastapi-instrumentator/blob/${src.tag}/CHANGELOG.md";
54 license = with lib.licenses; [
55 isc
56 bsd3
57 ];
58 maintainers = with lib.maintainers; [ bcdarwin ];
59 platforms = lib.platforms.unix;
60 };
61}