Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 asgiref,
11 django,
12 strawberry-graphql,
13
14 # optional-dependencies
15 django-debug-toolbar,
16 django-choices-field,
17
18 # check inputs
19 pytestCheckHook,
20 django-guardian,
21 django-model-utils,
22 django-mptt,
23 django-polymorphic,
24 django-tree-queries,
25 factory-boy,
26 pillow,
27 psycopg2,
28 pytest-asyncio,
29 pytest-cov-stub,
30 pytest-django,
31 pytest-mock,
32 pytest-snapshot,
33}:
34
35buildPythonPackage rec {
36 pname = "strawberry-django";
37 version = "0.74.1";
38 pyproject = true;
39
40 src = fetchFromGitHub {
41 owner = "strawberry-graphql";
42 repo = "strawberry-django";
43 tag = version;
44 hash = "sha256-8T5lYM5JrxbeDCgvSGvBsimsF+tMwjS1hroqw2Gf7aA=";
45 };
46
47 postPatch = ''
48 # django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the required STATIC_URL setting.
49 echo 'STATIC_URL = "static/"' >> tests/django_settings.py
50 '';
51
52 build-system = [
53 hatchling
54 ];
55
56 dependencies = [
57 django
58 asgiref
59 strawberry-graphql
60 ];
61
62 optional-dependencies = {
63 debug-toolbar = [ django-debug-toolbar ];
64 enum = [ django-choices-field ];
65 };
66
67 nativeCheckInputs = [
68 pytestCheckHook
69
70 django-guardian
71 django-model-utils
72 django-mptt
73 django-polymorphic
74 django-tree-queries
75 factory-boy
76 pillow
77 psycopg2
78 pytest-asyncio
79 pytest-cov-stub
80 pytest-django
81 pytest-mock
82 pytest-snapshot
83 ]
84 ++ optional-dependencies.debug-toolbar
85 ++ optional-dependencies.enum;
86
87 pythonImportsCheck = [ "strawberry_django" ];
88
89 meta = {
90 description = "Strawberry GraphQL Django extension";
91 homepage = "https://github.com/strawberry-graphql/strawberry-django";
92 changelog = "https://github.com/strawberry-graphql/strawberry-django/blob/${src.tag}/CHANGELOG.md";
93 license = lib.licenses.mit;
94 maintainers = with lib.maintainers; [ minijackson ];
95 };
96}