1{ lib
2, buildPythonPackage
3, pythonOlder
4, isPyPy
5, fetchFromGitHub
6
7# build
8, cython
9, setuptools
10
11# tests
12, aiofiles
13, cbor2
14, httpx
15, msgpack
16, mujson
17, orjson
18, pytest-asyncio
19, pytestCheckHook
20, pyyaml
21, rapidjson
22, requests
23, testtools
24, ujson
25, uvicorn
26, websockets
27}:
28
29buildPythonPackage rec {
30 pname = "falcon";
31 version = "3.1.0";
32 format = "pyproject";
33 disabled = pythonOlder "3.5";
34
35 src = fetchFromGitHub {
36 owner = "falconry";
37 repo = pname;
38 rev = version;
39 hash = "sha256-Y6bD0GCXhqpvMV+/i1v59p2qWZ91f2ey7sPQrVALY54=";
40 };
41
42 nativeBuildInputs = [
43 setuptools
44 ] ++ lib.optionals (!isPyPy) [
45 cython
46 ];
47
48 preCheck = ''
49 export HOME=$TMPDIR
50 cp -R tests examples $TMPDIR
51 pushd $TMPDIR
52 '';
53
54 postCheck = ''
55 popd
56 '';
57
58 checkInputs = [
59 # https://github.com/falconry/falcon/blob/master/requirements/tests
60 pytestCheckHook
61 pyyaml
62 requests
63 rapidjson
64 orjson
65
66 # ASGI specific
67 pytest-asyncio
68 aiofiles
69 httpx
70 uvicorn
71 websockets
72
73 # handler specific
74 cbor2
75 msgpack
76 mujson
77 ujson
78 ] ++ lib.optionals (pythonOlder "3.10") [
79 testtools
80 ];
81
82 pytestFlagsArray = [
83 "tests"
84 ];
85
86 disabledTestPaths = [
87 # needs a running server
88 "tests/asgi/test_asgi_servers.py"
89 ];
90
91 meta = with lib; {
92 description = "An unladen web framework for building APIs and app backends";
93 homepage = "https://falconframework.org/";
94 license = licenses.asl20;
95 maintainers = with maintainers; [ desiderius ];
96 };
97
98}