git.iko.soy/typeable/nixpkgs
on master help sign in
python3Packages.json-logging: init at 1.3.0
commit98822ee896a3a5aeb5c6747da0ea40f86d5ac167 authorAluísio Augusto Silva Gonçalves <aluisio@aasg.name> dateFri 23 Apr 2021, 15:18 (6 years ago) parentc89bf45
2 files changed+51
pkgs/development/python-modules/json-logging/default.nix+49 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/json-logging/default.nixnew file+49
@@ -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+}
pkgs/top-level/python-packages.nix+2
@@ -3443,6 +3443,8 @@ in {
34433443
34443444 jsonlines = callPackage ../development/python-modules/jsonlines { };
34453445
3446+ json-logging = callPackage ../development/python-modules/json-logging { };
3447+
34463448 jsonmerge = callPackage ../development/python-modules/jsonmerge { };
34473449
34483450 json-merge-patch = callPackage ../development/python-modules/json-merge-patch { };