1{
2 lib,
3 fetchFromGitHub,
4 pythonOlder,
5 buildPythonPackage,
6
7 # build-system
8 hatchling,
9
10 # dependencies
11 django,
12 sqlparse,
13
14 # tests
15 django-csp,
16 html5lib,
17 jinja2,
18 pygments,
19}:
20
21buildPythonPackage rec {
22 pname = "django-debug-toolbar";
23 version = "6.0.0";
24 pyproject = true;
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "jazzband";
30 repo = "django-debug-toolbar";
31 tag = version;
32 hash = "sha256-ZNevSqEpTdk0cZeMzOpbtatEiV9SAsVUlRb9YddcAGY=";
33 };
34
35 postPatch = ''
36 # not actually used and we don't have django-template-partials packaged
37 sed -i "/template_partials/d" tests/settings.py
38 '';
39
40 build-system = [ hatchling ];
41
42 dependencies = [
43 django
44 sqlparse
45 ];
46
47 env = {
48 DB_BACKEND = "sqlite3";
49 DB_NAME = ":memory:";
50 DJANGO_SETTINGS_MODULE = "tests.settings";
51 };
52
53 nativeCheckInputs = [
54 django-csp
55 html5lib
56 jinja2
57 pygments
58 ];
59
60 checkPhase = ''
61 runHook preCheck
62 python -m django test tests
63 runHook postCheck
64 '';
65
66 pythonImportsCheck = [ "debug_toolbar" ];
67
68 meta = with lib; {
69 description = "Configurable set of panels that display debug information about the current request/response";
70 homepage = "https://github.com/jazzband/django-debug-toolbar";
71 changelog = "https://django-debug-toolbar.readthedocs.io/en/latest/changes.html";
72 license = licenses.bsd3;
73 maintainers = with maintainers; [ ];
74 };
75}