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
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
# 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";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "3.1.1";
|
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;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-5Lhz4qI/x7yK9tqQg4CvYNug+fp9l6ErNGH1pVybZ6c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
] ++ lib.optionals (!isPyPy) [
|
2022-04-27 09:35:20 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|