summary refs log tree commit diff
path: root/pkgs/development/python-modules/runway-python/default.nix
blob: c47054632c6fa1297e24e32c43f8ca4aa9c8c0a8 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{ lib
, buildPythonPackage
, pythonAtLeast
, fetchFromGitHub
, colorcet
, cryptography
, flask
, flask-compress
, flask-cors
, flask-sockets
, gevent
, imageio
, numpy
, pillow
, pyopenssl
, scipy
, six
, unidecode
, urllib3
, wget
, deepdiff
, pytestCheckHook
, pytestcov
, websocket-client
}:

buildPythonPackage rec {
  pname = "runway-python";
  version = "0.6.1";

  src = fetchFromGitHub {
    owner = "runwayml";
    repo = "model-sdk";
    rev = version;
    sha256 = "1ww2wai1qnly8i7g42vhkkbs4yp7wi9x4fjdxsg9fl3izjra0zs2";
  };

  propagatedBuildInputs = [
    colorcet
    cryptography
    flask
    flask-compress
    flask-cors
    flask-sockets
    gevent
    imageio
    numpy
    pillow
    pyopenssl
    scipy
    six
    unidecode
    urllib3
    wget
  ];

  pythonImportsCheck = [
    "runway"
  ];

  checkInputs = [
    deepdiff
    pytestCheckHook
    pytestcov
    websocket-client
  ];

  disabledTests = [
    # these tests require network
    "test_file_deserialization_remote"
    "test_file_deserialization_absolute_directory"
    "test_file_deserialization_remote_directory"
  ] ++ lib.optionals (pythonAtLeast "3.9") [
     # AttributeError: module 'base64' has no attribute 'decodestring
     # https://github.com/runwayml/model-sdk/issues/99
     "test_image_serialize_and_deserialize"
     "test_segmentation_serialize_and_deserialize_colormap"
     "test_segmentation_serialize_and_deserialize_labelmap"
  ];

  meta = {
    description = "Helper library for creating Runway models";
    homepage = "https://github.com/runwayml/model-sdk";
    license = with lib.licenses; [ mit ];
    maintainers = with lib.maintainers; [ prusnak ];
  };
}