python312Packages.pint-xarray: init at 0.4 (#377344)
[NixPkgs.git] / pkgs / development / python-modules / django-auditlog / default.nix
blob880512f617debc77c613b13c1e9cc5698c9bf2c6
2   lib,
3   stdenv,
4   buildPythonPackage,
5   fetchFromGitHub,
6   setuptools,
7   setuptools-scm,
8   django,
9   python-dateutil,
10   freezegun,
11   psycopg2,
12   postgresql,
13   postgresqlTestHook,
14   python,
17 buildPythonPackage rec {
18   pname = "django-auditlog";
19   version = "3.0.0";
20   pyproject = true;
22   src = fetchFromGitHub {
23     owner = "jazzband";
24     repo = "django-auditlog";
25     rev = "v${version}";
26     hash = "sha256-SJ4GJp/gVIxiLbdAj3ZS+weevqIDZCMQnW/pqc5liJU=";
27   };
29   nativeBuildInputs = [
30     setuptools
31     setuptools-scm
32   ];
34   propagatedBuildInputs = [
35     django
36     python-dateutil
37   ];
39   nativeCheckInputs = [
40     freezegun
41     psycopg2
42     postgresql
43     postgresqlTestHook
44   ];
46   doCheck = stdenv.hostPlatform.isLinux; # postgres fails to allocate shm on darwin
48   postgresqlTestUserOptions = "LOGIN SUPERUSER";
50   checkPhase = ''
51     runHook preCheck
53     # strip escape codes otherwise tests fail
54     # see https://github.com/jazzband/django-auditlog/issues/644
55     TEST_DB_USER=$PGUSER \
56     TEST_DB_HOST=$PGHOST \
57     ${python.interpreter} runtests.py | cat
59     runHook postCheck
60   '';
62   pythonImportsCheck = [ "auditlog" ];
64   meta = with lib; {
65     changelog = "https://github.com/jazzband/django-auditlog/blob/v${version}/CHANGELOG.md";
66     description = "Django app that keeps a log of changes made to an object";
67     downloadPage = "https://github.com/jazzband/django-auditlog";
68     license = licenses.mit;
69     maintainers = with maintainers; [ leona ];
70   };