2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-12-06 16:07:01 +00:00
|
|
|
, pythonOlder
|
2022-04-27 09:35:20 +00:00
|
|
|
, isPyPy
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
|
|
|
# build
|
|
|
|
, cython
|
|
|
|
|
|
|
|
# tests
|
2021-12-06 16:07:01 +00:00
|
|
|
, aiofiles
|
|
|
|
, cbor2
|
|
|
|
, httpx
|
|
|
|
, msgpack
|
|
|
|
, mujson
|
|
|
|
, orjson
|
|
|
|
, pytest-asyncio
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, pyyaml
|
2021-12-06 16:07:01 +00:00
|
|
|
, rapidjson
|
2020-04-24 23:36:52 +00:00
|
|
|
, requests
|
|
|
|
, testtools
|
2021-12-06 16:07:01 +00:00
|
|
|
, ujson
|
|
|
|
, uvicorn
|
|
|
|
, websockets
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "falcon";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "3.1.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "falconry";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-Y6bD0GCXhqpvMV+/i1v59p2qWZ91f2ey7sPQrVALY54=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = lib.optionals (!isPyPy) [
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
cp -R tests examples $TMPDIR
|
|
|
|
pushd $TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
checkInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
# https://github.com/falconry/falcon/blob/master/requirements/tests
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pyyaml
|
|
|
|
requests
|
2022-04-27 09:35:20 +00:00
|
|
|
rapidjson
|
|
|
|
orjson
|
|
|
|
|
|
|
|
# ASGI specific
|
|
|
|
pytest-asyncio
|
|
|
|
aiofiles
|
|
|
|
httpx
|
2021-12-06 16:07:01 +00:00
|
|
|
uvicorn
|
|
|
|
websockets
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
# handler specific
|
|
|
|
cbor2
|
|
|
|
msgpack
|
|
|
|
mujson
|
|
|
|
ujson
|
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
testtools
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"tests"
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# needs a running server
|
|
|
|
"tests/asgi/test_asgi_servers.py"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An unladen web framework for building APIs and app backends";
|
|
|
|
homepage = "https://falconframework.org/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ desiderius ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|