about summary refs log tree commit diff
path: root/pkgs/development/python-modules/strawberry-graphql/default.nix
blob: ca4b1b81725dc67fe044f30244ff910a9f971c2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch, poetry-core, pythonOlder
, click, backports-cached-property, graphql-core, pygments, python-dateutil, python-multipart, typing-extensions
, aiohttp, asgiref, chalice, django, fastapi, flask, pydantic, sanic, starlette, uvicorn
}:

buildPythonPackage rec {
  pname = "strawberry-graphql";
  version = "0.125.0";
  format = "pyproject";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "strawberry-graphql";
    repo = "strawberry";
    rev = version;
    sha256 = "sha256-8ERmG10qNiYg9Zr8oUZk/Uz68sCE+oWrqmJ5kUMqbRo=";
  };

  patches = [
    (fetchpatch {
      name = "switch-to-poetry-core.patch";
      url = "https://github.com/strawberry-graphql/strawberry/commit/710bb96f47c244e78fc54c921802bcdb48f5f421.patch";
      hash = "sha256-ekUZ2hDPCqwXp9n0YjBikwSkhCmVKUzQk7LrPECcD7Y=";
    })
  ];

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    click backports-cached-property graphql-core pygments python-dateutil python-multipart typing-extensions
    aiohttp asgiref chalice django fastapi flask pydantic sanic starlette uvicorn
  ];

  pythonImportsCheck = [
    "strawberry"
  ];

  meta = with lib; {
    description = "A GraphQL library for Python that leverages type annotations";
    homepage = "https://strawberry.rocks";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ izorkin ];
  };
}