summary refs log tree commit diff
path: root/pkgs/development/python-modules/warlock/default.nix
blob: c20723e8d6e25a812e3486123bd86d53e9fab8d0 (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
55
56
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, jsonpatch
, jsonschema
, six
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "warlock";
  version = "1.3.3";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "bcwaldon";
    repo = pname;
    rev = version;
    hash = "sha256-59V4KOwjs/vhA3F3E0j3p5L4JnKPgcExN+mgSWs0Cn0=";
  };

  postPatch = ''
    substituteInPlace requirements.txt \
      --replace "jsonschema>=0.7,<4" "jsonschema"
    sed -i "/--cov/d" pytest.ini
  '';

  propagatedBuildInputs = [
    jsonpatch
    jsonschema
    six
  ];

  checkInputs = [
    pytestCheckHook
  ];

  disabledTests = [
    # https://github.com/bcwaldon/warlock/issues/64
    "test_recursive_models"
  ];

  pythonImportsCheck = [
    "warlock"
  ];

  meta = with lib; {
    description = "Python object model built on JSON schema and JSON patch";
    homepage = "https://github.com/bcwaldon/warlock";
    license = licenses.asl20;
    maintainers = with maintainers; [ ];
  };
}