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.1";
26 format = "setuptools";
27
28 disabled = pythonOlder "3.6";
29
30 src = fetchFromGitHub {
31 owner = "graphql-python";
32 repo = pname;
33 rev = "refs/tags/v${version}";
34 hash = "sha256-wzU9U4mYvBf43qBQi20ewKtmw1eFskQk+nnsdaM7HQM=";
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 [
66 # https://github.com/graphql-python/graphene-django/issues/1510
67 "test_should_filepath_convert_string"
68 "test_should_choice_convert_enum"
69 "test_should_multiplechoicefield_convert_to_list_of_enum"
70 "test_perform_mutate_success_with_enum_choice_field"
71 ]
72 ++ lib.optionals stdenv.isDarwin [
73 # this test touches files in the "/" directory and fails in darwin sandbox
74 "test_should_filepath_convert_string"
75 ];
76
77 meta = with lib; {
78 description = "Integrate GraphQL into your Django project";
79 homepage = "https://github.com/graphql-python/graphene-django";
80 changelog = "https://github.com/graphql-python/graphene-django/releases/tag/v${version}";
81 license = licenses.mit;
82 maintainers = with maintainers; [ hexa ];
83 };
84}