1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 pythonOlder,
6 fetchFromGitHub,
7
8 graphene,
9 graphql-core,
10 django,
11 djangorestframework,
12 promise,
13 text-unidecode,
14
15 django-filter,
16 mock,
17 py,
18 pytest-django,
19 pytest-random-order,
20 pytest7CheckHook,
21}:
22
23buildPythonPackage rec {
24 pname = "graphene-django";
25 version = "3.2.3";
26 format = "setuptools";
27
28 disabled = pythonOlder "3.6";
29
30 src = fetchFromGitHub {
31 owner = "graphql-python";
32 repo = "graphene-django";
33 tag = "v${version}";
34 hash = "sha256-uMkzgXn3YRgEU46Sv5lg60cvetHir9bv0mzJGDv79DI=";
35 };
36
37 postPatch = ''
38 substituteInPlace setup.py \
39 --replace '"pytest-runner"' ""
40 '';
41
42 propagatedBuildInputs = [
43 djangorestframework
44 graphene
45 graphql-core
46 django
47 promise
48 text-unidecode
49 ];
50
51 preCheck = ''
52 export DJANGO_SETTINGS_MODULE=examples.django_test_settings
53 '';
54
55 nativeCheckInputs = [
56 django-filter
57 mock
58 py
59 pytest-django
60 pytest-random-order
61 pytest7CheckHook
62 ];
63
64 disabledTests = [
65 # https://github.com/graphql-python/graphene-django/issues/1510
66 "test_should_filepath_convert_string"
67 "test_should_choice_convert_enum"
68 "test_should_multiplechoicefield_convert_to_list_of_enum"
69 "test_perform_mutate_success_with_enum_choice_field"
70 ]
71 ++ lib.optionals stdenv.hostPlatform.isDarwin [
72 # this test touches files in the "/" directory and fails in darwin sandbox
73 "test_should_filepath_convert_string"
74 ];
75
76 meta = with lib; {
77 description = "Integrate GraphQL into your Django project";
78 homepage = "https://github.com/graphql-python/graphene-django";
79 changelog = "https://github.com/graphql-python/graphene-django/releases/tag/v${version}";
80 license = licenses.mit;
81 maintainers = with maintainers; [ hexa ];
82 };
83}