diff options
author | Aluísio Augusto Silva Gonçalves <aluisio@aasg.name> | 2021-04-23 15:18:07 -0300 |
---|---|---|
committer | Aluísio Augusto Silva Gonçalves <aluisio@aasg.name> | 2021-04-30 11:33:04 -0300 |
commit | 98822ee896a3a5aeb5c6747da0ea40f86d5ac167 (patch) | |
tree | e0c1f009e3cf310acfb51cc4e1fe143d3a6cf179 /pkgs/development/python-modules/json-logging | |
parent | c89bf4519524a2cc428b7da12d64cb1f76503335 (diff) |
python3Packages.json-logging: init at 1.3.0
Diffstat (limited to 'pkgs/development/python-modules/json-logging')
-rw-r--r-- | pkgs/development/python-modules/json-logging/default.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/json-logging/default.nix b/pkgs/development/python-modules/json-logging/default.nix new file mode 100644 index 0000000000000..3d34cb2475abe --- /dev/null +++ b/pkgs/development/python-modules/json-logging/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, pytestCheckHook +, wheel +, flask +, sanic +, fastapi +, uvicorn +, requests +}: + +buildPythonPackage rec { + pname = "json-logging"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "bobbui"; + repo = "json-logging-python"; + rev = version; + hash = "sha256-0eIhOi30r3ApyVkiBdTQps5tNj7rI+q8TjNWxTnhtMQ="; + }; + patches = [ + # Fix tests picking up test modules instead of real packages. + (fetchpatch { + url = "https://github.com/bobbui/json-logging-python/commit/6fdb64deb42fe48b0b12bda0442fd5ac5f03107f.patch"; + sha256 = "sha256-BLfARsw2FdvY22NCaFfdFgL9wTmEZyVIi3CQpB5qU0Y="; + }) + ]; + + # - Quart is not packaged for Nixpkgs. + # - FastAPI is broken, see #112701 and tiangolo/fastapi#2335. + checkInputs = [ wheel flask /*quart*/ sanic /*fastapi*/ uvicorn requests pytestCheckHook ]; + disabledTests = [ "quart" "fastapi" ]; + disabledTestPaths = [ "tests/test_fastapi.py" ]; + # Tests spawn servers and try to connect to them. + __darwinAllowLocalNetworking = true; + + meta = with lib; { + description = "Python library to emit logs in JSON format"; + longDescription = '' + 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. + ''; + homepage = "https://github.com/bobbui/json-logging-python"; + license = licenses.asl20; + maintainers = with maintainers; [ AluisioASG ]; + }; +} |