2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
isPy27,
|
|
|
|
falcon,
|
|
|
|
requests,
|
|
|
|
pytestCheckHook,
|
|
|
|
marshmallow,
|
|
|
|
mock,
|
|
|
|
numpy,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hug";
|
|
|
|
version = "2.6.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hugapi";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "05rsv16g7ph100p8kl4l2jba0y4wcpp3xblc02mfp67zp1279vaq";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
falcon
|
|
|
|
requests
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
mock
|
|
|
|
marshmallow
|
|
|
|
pytestCheckHook
|
|
|
|
numpy
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py --replace '"pytest-runner"' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# some tests need the `hug` CLI on the PATH
|
|
|
|
export PATH=$out/bin:$PATH
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# some tests attempt network access
|
|
|
|
"test_datagram_request"
|
|
|
|
"test_request"
|
|
|
|
# these tests use an unstable test dependency (https://github.com/hugapi/hug/issues/859)
|
|
|
|
"test_marshmallow_custom_context"
|
|
|
|
"test_marshmallow_schema"
|
|
|
|
"test_transform"
|
|
|
|
"test_validate_route_args_negative_case"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Python framework that makes developing APIs as simple as possible, but no simpler";
|
2021-02-05 17:12:51 +00:00
|
|
|
homepage = "https://github.com/hugapi/hug";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-12-06 16:07:01 +00:00
|
|
|
# Missing support for later falcon releases
|
|
|
|
broken = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|