1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 isPy27,
6 falcon,
7 requests,
8 pytestCheckHook,
9 marshmallow,
10 mock,
11 numpy,
12}:
13
14buildPythonPackage rec {
15 pname = "hug";
16 version = "2.6.0";
17 format = "setuptools";
18 disabled = isPy27;
19
20 src = fetchFromGitHub {
21 owner = "hugapi";
22 repo = pname;
23 rev = version;
24 sha256 = "05rsv16g7ph100p8kl4l2jba0y4wcpp3xblc02mfp67zp1279vaq";
25 };
26
27 propagatedBuildInputs = [
28 falcon
29 requests
30 ];
31
32 nativeCheckInputs = [
33 mock
34 marshmallow
35 pytestCheckHook
36 numpy
37 ];
38
39 postPatch = ''
40 substituteInPlace setup.py --replace '"pytest-runner"' ""
41 '';
42
43 preCheck = ''
44 # some tests need the `hug` CLI on the PATH
45 export PATH=$out/bin:$PATH
46 '';
47
48 disabledTests = [
49 # some tests attempt network access
50 "test_datagram_request"
51 "test_request"
52 # these tests use an unstable test dependency (https://github.com/hugapi/hug/issues/859)
53 "test_marshmallow_custom_context"
54 "test_marshmallow_schema"
55 "test_transform"
56 "test_validate_route_args_negative_case"
57 ];
58
59 meta = with lib; {
60 description = "Python framework that makes developing APIs as simple as possible, but no simpler";
61 homepage = "https://github.com/hugapi/hug";
62 license = licenses.mit;
63 # Missing support for later falcon releases
64 broken = true;
65 };
66}