@@ -0,0 +1,49 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, fetchpatch
5+, pytestCheckHook
6+, wheel
7+, flask
8+, sanic
9+, fastapi
10+, uvicorn
11+, requests
12+}:
13+
14+buildPythonPackage rec {
15+ pname = "json-logging";
16+ version = "1.3.0";
17+
18+ src = fetchFromGitHub {
19+ owner = "bobbui";
20+ repo = "json-logging-python";
21+ rev = version;
22+ hash = "sha256-0eIhOi30r3ApyVkiBdTQps5tNj7rI+q8TjNWxTnhtMQ=";
23+ };
24+ patches = [
25+ # Fix tests picking up test modules instead of real packages.
26+ (fetchpatch {
27+ url = "https://github.com/bobbui/json-logging-python/commit/6fdb64deb42fe48b0b12bda0442fd5ac5f03107f.patch";
28+ sha256 = "sha256-BLfARsw2FdvY22NCaFfdFgL9wTmEZyVIi3CQpB5qU0Y=";
29+ })
30+ ];
31+
32+ # - Quart is not packaged for Nixpkgs.
33+ # - FastAPI is broken, see #112701 and tiangolo/fastapi#2335.
34+ checkInputs = [ wheel flask /*quart*/ sanic /*fastapi*/ uvicorn requests pytestCheckHook ];
35+ disabledTests = [ "quart" "fastapi" ];
36+ disabledTestPaths = [ "tests/test_fastapi.py" ];
37+ # Tests spawn servers and try to connect to them.
38+ __darwinAllowLocalNetworking = true;
39+
40+ meta = with lib; {
41+ description = "Python library to emit logs in JSON format";
42+ longDescription = ''
43+ Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK, EFK, AWS Cloudwatch, GCP Stackdriver.
44+ '';
45+ homepage = "https://github.com/bobbui/json-logging-python";
46+ license = licenses.asl20;
47+ maintainers = with maintainers; [ AluisioASG ];
48+ };
49+}