1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 pythonOlder,
7
8 # build
9 poetry-core,
10
11 # runtime
12 graphql-core,
13 typing-extensions,
14
15 # tests
16 pytest-asyncio,
17 pytest-describe,
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "graphql-relay";
23 version = "3.2.0";
24 format = "pyproject";
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-H/HFEpg1bkgaC+AJzN/ySYMs5T8wVZwTOPIqDg0XJQw=";
29 };
30
31 # This project doesn't seem to actually need setuptools. To find out why it
32 # specifies it, follow up in:
33 #
34 # https://github.com/graphql-python/graphql-relay-py/issues/49
35 #
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace-fail "poetry_core>=1,<2" "poetry-core" \
39 --replace ', "setuptools>=59,<70"' ""
40 '';
41
42 nativeBuildInputs = [ poetry-core ];
43
44 propagatedBuildInputs = [ graphql-core ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ];
45
46 nativeCheckInputs = [
47 pytest-asyncio
48 pytest-describe
49 pytestCheckHook
50 ];
51
52 pythonImportsCheck = [ "graphql_relay" ];
53
54 meta = with lib; {
55 description = "Library to help construct a graphql-py server supporting react-relay";
56 homepage = "https://github.com/graphql-python/graphql-relay-py/";
57 license = licenses.mit;
58 maintainers = [ ];
59 };
60}