about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/hug/default.nix
blob: 46dfab1cd52c4d8430216fe43963e30a5557d692 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ lib , buildPythonPackage, fetchFromGitHub, isPy27
, falcon
, requests
, pytestCheckHook
, marshmallow
, mock
, numpy
}:

buildPythonPackage rec {
  pname = "hug";
  version = "2.6.0";
  format = "setuptools";
  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "hugapi";
    repo = pname;
    rev = version;
    sha256 = "05rsv16g7ph100p8kl4l2jba0y4wcpp3xblc02mfp67zp1279vaq";
  };

  propagatedBuildInputs = [ falcon requests ];

  nativeCheckInputs = [ mock marshmallow pytestCheckHook numpy ];

  postPatch = ''
    substituteInPlace setup.py --replace '"pytest-runner"' ""
  '';

  preCheck = ''
    # some tests need the `hug` CLI on the PATH
    export PATH=$out/bin:$PATH
  '';

  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"
  ];

  meta = with lib; {
    description = "A Python framework that makes developing APIs as simple as possible, but no simpler";
    homepage = "https://github.com/hugapi/hug";
    license = licenses.mit;
    # Missing support for later falcon releases
    broken = true;
  };
}