1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, isPy27
6, aiofiles
7, graphene
8, itsdangerous
9, jinja2
10, python-multipart
11, pyyaml
12, requests
13, aiosqlite
14, databases
15, pytestCheckHook
16, pytest-asyncio
17, typing-extensions
18, ApplicationServices
19}:
20
21buildPythonPackage rec {
22 pname = "starlette";
23 version = "0.14.2";
24 disabled = isPy27;
25
26 src = fetchFromGitHub {
27 owner = "encode";
28 repo = pname;
29 rev = version;
30 sha256 = "0fz28czvwiww693ig9vwdja59xxs7m0yp1df32ms1hzr99666bia";
31 };
32
33 postPatch = ''
34 # remove coverage arguments to pytest
35 sed -i '/--cov/d' setup.cfg
36 '';
37
38 propagatedBuildInputs = [
39 aiofiles
40 graphene
41 itsdangerous
42 jinja2
43 python-multipart
44 pyyaml
45 requests
46 ] ++ lib.optional stdenv.isDarwin [ ApplicationServices ];
47
48 checkInputs = [
49 aiosqlite
50 databases
51 pytest-asyncio
52 pytestCheckHook
53 typing-extensions
54 ];
55
56 # fails to import graphql, but integrated graphql support is about to
57 # be removed in 0.15, see https://github.com/encode/starlette/pull/1135.
58 disabledTestPaths = [ "tests/test_graphql.py" ];
59
60 pythonImportsCheck = [ "starlette" ];
61
62 meta = with lib; {
63 homepage = "https://www.starlette.io/";
64 description = "The little ASGI framework that shines";
65 license = licenses.bsd3;
66 maintainers = with maintainers; [ wd15 ];
67 };
68}