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.1";
32 format = "pyproject";
33 disabled = pythonOlder "3.5";
34
35 src = fetchFromGitHub {
36 owner = "falconry";
37 repo = pname;
38 rev = "refs/tags/${version}";
39 hash = "sha256-5Lhz4qI/x7yK9tqQg4CvYNug+fp9l6ErNGH1pVybZ6c=";
40 };
41
42 nativeBuildInputs = [
43 setuptools
44 ] ++ lib.optionals (!isPyPy) [
45 cython
46 ];
47
48 __darwinAllowLocalNetworking = true;
49
50 preCheck = ''
51 export HOME=$TMPDIR
52 cp -R tests examples $TMPDIR
53 pushd $TMPDIR
54 '';
55
56 postCheck = ''
57 popd
58 '';
59
60 nativeCheckInputs = [
61 # https://github.com/falconry/falcon/blob/master/requirements/tests
62 pytestCheckHook
63 pyyaml
64 requests
65 rapidjson
66 orjson
67
68 # ASGI specific
69 pytest-asyncio
70 aiofiles
71 httpx
72 uvicorn
73 websockets
74
75 # handler specific
76 cbor2
77 msgpack
78 mujson
79 ujson
80 ] ++ lib.optionals (pythonOlder "3.10") [
81 testtools
82 ];
83
84 pytestFlagsArray = [
85 "tests"
86 ];
87
88 disabledTestPaths = [
89 # needs a running server
90 "tests/asgi/test_asgi_servers.py"
91 ];
92
93 meta = with lib; {
94 description = "An unladen web framework for building APIs and app backends";
95 homepage = "https://falconframework.org/";
96 license = licenses.asl20;
97 maintainers = with maintainers; [ desiderius ];
98 };
99
100}