1{ lib
2, buildPythonPackage
3, pythonAtLeast
4, pythonOlder
5, fetchFromGitHub
6
7, graphene
8, graphql-core
9, django
10, djangorestframework
11, promise
12, text-unidecode
13
14, django-filter
15, mock
16, py
17, pytest-django
18, pytest-random-order
19, pytestCheckHook
20}:
21
22buildPythonPackage rec {
23 pname = "graphene-django";
24 version = "3.1.1";
25 format = "setuptools";
26
27 disabled = pythonOlder "3.6";
28
29 src = fetchFromGitHub {
30 owner = "graphql-python";
31 repo = pname;
32 rev = "refs/tags/v${version}";
33 hash = "sha256-xMEC2GEP39UVWqdLQMRjLOn93PY0aJWEnQRcn8YwxWo=";
34 };
35
36 postPatch = ''
37 substituteInPlace setup.py \
38 --replace '"pytest-runner"' ""
39 '';
40
41 propagatedBuildInputs = [
42 djangorestframework
43 graphene
44 graphql-core
45 django
46 promise
47 text-unidecode
48 ];
49
50 preCheck = ''
51 export DJANGO_SETTINGS_MODULE=examples.django_test_settings
52 '';
53
54 nativeCheckInputs = [
55 django-filter
56 mock
57 py
58 pytest-django
59 pytest-random-order
60 pytestCheckHook
61 ];
62
63 disabledTests = lib.optionals (pythonAtLeast "3.11") [
64 # Pèython 3.11 support, https://github.com/graphql-python/graphene-django/pull/1365
65 "test_django_objecttype_convert_choices_enum_naming_collisions"
66 "test_django_objecttype_choices_custom_enum_name"
67 "test_django_objecttype_convert_choices_enum_list"
68 "test_schema_representation"
69 ];
70
71 meta = with lib; {
72 description = "Integrate GraphQL into your Django project";
73 homepage = "https://github.com/graphql-python/graphene-django";
74 changelog = "https://github.com/graphql-python/graphene-django/releases/tag/v${version}";
75 license = licenses.mit;
76 maintainers = with maintainers; [ hexa ];
77 };
78}