2019-09-14 13:56:53 +01:00
|
|
|
{ lib , buildPythonPackage, fetchFromGitHub, isPy27
|
2018-10-16 21:04:36 +01:00
|
|
|
, falcon
|
2019-09-13 18:07:30 +01:00
|
|
|
, pytestrunner
|
2018-10-16 21:04:36 +01:00
|
|
|
, requests
|
2019-09-14 13:56:53 +01:00
|
|
|
, pytest
|
|
|
|
, marshmallow
|
|
|
|
, mock
|
|
|
|
, numpy
|
2018-10-16 21:04:36 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hug";
|
2019-09-13 18:07:30 +01:00
|
|
|
version = "2.6.0";
|
2018-10-16 21:04:36 +01:00
|
|
|
disabled = isPy27;
|
|
|
|
|
2019-09-14 13:56:53 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hugapi";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "05rsv16g7ph100p8kl4l2jba0y4wcpp3xblc02mfp67zp1279vaq";
|
2018-10-16 21:04:36 +01:00
|
|
|
};
|
|
|
|
|
2019-09-13 18:07:30 +01:00
|
|
|
nativeBuildInputs = [ pytestrunner ];
|
2018-10-16 21:04:36 +01:00
|
|
|
propagatedBuildInputs = [ falcon requests ];
|
|
|
|
|
2019-09-14 13:56:53 +01:00
|
|
|
checkInputs = [ mock marshmallow pytest numpy ];
|
|
|
|
checkPhase = ''
|
|
|
|
mv hug hug.hidden
|
|
|
|
# some tests attempt network access
|
|
|
|
PATH=$out/bin:$PATH pytest -k "not (test_request or test_datagram_request)"
|
|
|
|
'';
|
2018-10-16 21:04:36 +01:00
|
|
|
|
2019-09-13 18:07:30 +01:00
|
|
|
meta = with lib; {
|
2018-10-16 21:04:36 +01:00
|
|
|
description = "A Python framework that makes developing APIs as simple as possible, but no simpler";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/timothycrosley/hug";
|
2018-10-16 21:04:36 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|