1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 fetchpatch,
7
8 # build-system
9 poetry-core,
10
11 # dependencies
12 django,
13 django-debug-toolbar,
14 graphene-django,
15
16 # tests
17 pytest-django,
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "django-graphiql-debug-toolbar";
23 version = "0.2.0";
24 pyproject = true;
25 disabled = pythonOlder "3.6";
26
27 src = fetchFromGitHub {
28 owner = "flavors";
29 repo = "django-graphiql-debug-toolbar";
30 rev = version;
31 sha256 = "0fikr7xl786jqfkjdifymqpqnxy4qj8g3nlkgfm24wwq0za719dw";
32 };
33
34 patches = [
35 # Add compatibility for py-django-debug-toolbar >= 4.4.6
36 # https://github.com/flavors/django-graphiql-debug-toolbar/pull/27
37 (fetchpatch {
38 url = "https://github.com/flavors/django-graphiql-debug-toolbar/commit/2b42fdb1bc40109d9bb0ae1fb4d2163d13904724.patch";
39 hash = "sha256-ywTLqXlAxA2DCacrJOqmB7jSzfpeuGTX2ETu0fKmhq4=";
40 })
41 ];
42
43 build-system = [ poetry-core ];
44
45 dependencies = [
46 django
47 django-debug-toolbar
48 graphene-django
49 ];
50
51 pythonImportsCheck = [ "graphiql_debug_toolbar" ];
52
53 nativeCheckInputs = [
54 pytest-django
55 pytestCheckHook
56 ];
57
58 preCheck = ''
59 export DB_BACKEND=sqlite
60 export DB_NAME=:memory:
61 export DJANGO_SETTINGS_MODULE=tests.settings
62 '';
63
64 doCheck = false; # tests broke with django-debug-toolbar 6.0
65
66 meta = with lib; {
67 changelog = "https://github.com/flavors/django-graphiql-debug-toolbar/releases/tag/${src.rev}";
68 description = "Django Debug Toolbar for GraphiQL IDE";
69 homepage = "https://github.com/flavors/django-graphiql-debug-toolbar";
70 license = licenses.mit;
71 maintainers = with maintainers; [ hexa ];
72 };
73}