1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8 setuptools,
9
10 # dependencies
11 asgiref,
12 django,
13 strawberry-graphql,
14
15 # optional-dependencies
16 django-debug-toolbar,
17 django-choices-field,
18
19 # check inputs
20 pytestCheckHook,
21 django-guardian,
22 django-mptt,
23 django-polymorphic,
24 django-tree-queries,
25 factory-boy,
26 pillow,
27 psycopg2,
28 pytest-cov-stub,
29 pytest-django,
30 pytest-mock,
31 pytest-snapshot,
32}:
33
34buildPythonPackage rec {
35 pname = "strawberry-django";
36 version = "0.57.1";
37 pyproject = true;
38
39 src = fetchFromGitHub {
40 owner = "strawberry-graphql";
41 repo = "strawberry-django";
42 tag = "v${version}";
43 hash = "sha256-nwqb9AVNQNIRdjYcutTaI3YfwuMDLP4mUirSXFq+WnI=";
44 };
45
46 build-system = [
47 poetry-core
48 setuptools
49 ];
50
51 dependencies = [
52 django
53 asgiref
54 strawberry-graphql
55 ];
56
57 optional-dependencies = {
58 debug-toolbar = [ django-debug-toolbar ];
59 enum = [ django-choices-field ];
60 };
61
62 nativeCheckInputs =
63 [
64 pytestCheckHook
65
66 django-guardian
67 django-mptt
68 django-polymorphic
69 django-tree-queries
70 factory-boy
71 pillow
72 psycopg2
73 pytest-cov-stub
74 pytest-django
75 pytest-mock
76 pytest-snapshot
77 ]
78 ++ optional-dependencies.debug-toolbar
79 ++ optional-dependencies.enum;
80
81 pythonImportsCheck = [ "strawberry_django" ];
82
83 meta = {
84 description = "Strawberry GraphQL Django extension";
85 homepage = "https://github.com/strawberry-graphql/strawberry-django";
86 changelog = "https://github.com/strawberry-graphql/strawberry-django/blob/${src.tag}/CHANGELOG.md";
87 license = lib.licenses.mit;
88 maintainers = with lib.maintainers; [ minijackson ];
89 };
90}