2023-08-22 20:05:09 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, buildPythonPackage
|
2023-02-02 18:25:31 +00:00
|
|
|
, pythonAtLeast
|
2021-12-06 16:07:01 +00:00
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
|
|
|
, graphene
|
|
|
|
, graphql-core
|
|
|
|
, django
|
|
|
|
, djangorestframework
|
|
|
|
, promise
|
|
|
|
, text-unidecode
|
|
|
|
|
|
|
|
, django-filter
|
|
|
|
, mock
|
2023-01-20 10:41:00 +00:00
|
|
|
, py
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytest-django
|
|
|
|
, pytest-random-order
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "graphene-django";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "3.2.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "graphql-python";
|
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-SOLY3NogovwQ5gr2gnvOcROWpbk9p134wI2f9FKr+5M=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '"pytest-runner"' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
djangorestframework
|
|
|
|
graphene
|
|
|
|
graphql-core
|
|
|
|
django
|
|
|
|
promise
|
|
|
|
text-unidecode
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export DJANGO_SETTINGS_MODULE=examples.django_test_settings
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
django-filter
|
|
|
|
mock
|
2023-01-20 10:41:00 +00:00
|
|
|
py
|
2021-12-06 16:07:01 +00:00
|
|
|
pytest-django
|
|
|
|
pytest-random-order
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.11") [
|
2023-08-22 20:05:09 +00:00
|
|
|
# Python 3.11 support, https://github.com/graphql-python/graphene-django/pull/1365
|
2023-02-02 18:25:31 +00:00
|
|
|
"test_django_objecttype_convert_choices_enum_naming_collisions"
|
|
|
|
"test_django_objecttype_choices_custom_enum_name"
|
|
|
|
"test_django_objecttype_convert_choices_enum_list"
|
|
|
|
"test_schema_representation"
|
2023-08-22 20:05:09 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# this test touches files in the "/" directory and fails in darwin sandbox
|
|
|
|
"test_should_filepath_convert_string"
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Integrate GraphQL into your Django project";
|
|
|
|
homepage = "https://github.com/graphql-python/graphene-django";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/graphql-python/graphene-django/releases/tag/v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|