summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-debug-toolbar/default.nix
blob: e7820589c481750eee3ed2c6065cb702b0ed0d91 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  lib,
  fetchFromGitHub,
  pythonOlder,
  buildPythonPackage,

  # build-system
  hatchling,

  # dependencies
  django,
  sqlparse,

  # tests
  django-csp,
  html5lib,
  jinja2,
  pygments,
  pytest-django,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "django-debug-toolbar";
  version = "5.0.1";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "jazzband";
    repo = "django-debug-toolbar";
    tag = version;
    hash = "sha256-Q0joSIFXhoVmNQ+AfESdEWUGY1xmJzr4iR6Ak54YM7c=";
  };

  build-system = [ hatchling ];

  dependencies = [
    django
    sqlparse
  ];

  env = {
    DB_BACKEND = "sqlite3";
    DB_NAME = ":memory:";
    DJANGO_SETTINGS_MODULE = "tests.settings";
  };

  nativeCheckInputs = [
    django-csp
    html5lib
    jinja2
    pygments
  ];

  checkPhase = ''
    runHook preCheck
    python -m django test tests
    runHook postCheck
  '';

  pythonImportsCheck = [ "debug_toolbar" ];

  meta = with lib; {
    description = "Configurable set of panels that display debug information about the current request/response";
    homepage = "https://github.com/jazzband/django-debug-toolbar";
    changelog = "https://django-debug-toolbar.readthedocs.io/en/latest/changes.html";
    license = licenses.bsd3;
    maintainers = with maintainers; [ yuu ];
  };
}