Skip to content

Commit

Permalink
Merge pull request #309979 from TomaSajt/json-logging
Browse files Browse the repository at this point in the history
python312Packages.json-logging: fix tests on python312, small cleanup
  • Loading branch information
mweinelt authored May 8, 2024
2 parents 01f288e + e499119 commit 1a6246d
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions pkgs/development/python-modules/json-logging/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
, httpx
, pytestCheckHook
, pythonOlder
, pythonAtLeast
, quart
, requests
, sanic
, setuptools
, uvicorn
, wheel
}:

buildPythonPackage rec {
pname = "json-logging";
version = "1.5.0-rc0";
format = "setuptools";
pyproject = true;

disabled = pythonOlder "3.7";

Expand All @@ -27,16 +28,28 @@ buildPythonPackage rec {
hash = "sha256-WOAEY1pONH+Gx1b8zHZDMNgJJSn7jvMO60LYTA8z/dE=";
};

nativeCheckInputs = [
# The logging module introduced the `taskName` field in Python 3.12, which the tests don't expect
postPatch = lib.optionalString (pythonAtLeast "3.12") ''
substituteInPlace tests/helpers/constants.py \
--replace-fail '"written_at",' '"taskName", "written_at",'
'';

build-system = [
setuptools
];

dependencies = [
fastapi
flask
httpx
pytestCheckHook
quart
requests
sanic
uvicorn
wheel
];

nativeCheckInputs = [
pytestCheckHook
];

pythonImportsCheck = [
Expand Down

0 comments on commit 1a6246d

Please sign in to comment.