about summary refs log tree commit diff
path: root/pkgs/development/python-modules/runway-python
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2021-05-07 20:25:29 +0200
committerJonathan Ringer <jonringer@users.noreply.github.com>2021-05-07 11:57:01 -0700
commit12493f272b466473c59f1f42a8e2c8df55e99158 (patch)
treec6d9e2b4e5c0610c0b95d9c4f8721b567c6a8f10 /pkgs/development/python-modules/runway-python
parent5ae90276c38faec9c1e18b5e7b71af9eebd1b2af (diff)
python3Packages.runway-python: fix build, enable tests
Diffstat (limited to 'pkgs/development/python-modules/runway-python')
-rw-r--r--pkgs/development/python-modules/runway-python/default.nix50
1 files changed, 39 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/runway-python/default.nix b/pkgs/development/python-modules/runway-python/default.nix
index 69b928aad0898..9244a94d2357a 100644
--- a/pkgs/development/python-modules/runway-python/default.nix
+++ b/pkgs/development/python-modules/runway-python/default.nix
@@ -1,33 +1,43 @@
 { lib
 , buildPythonPackage
-, fetchPypi
+, pythonAtLeast
+, fetchFromGitHub
+, colorcet
+, cryptography
 , flask
 , flask-compress
 , flask-cors
 , flask-sockets
+, gevent
 , imageio
 , numpy
-, scipy
 , pillow
-, gevent
-, wget
+, pyopenssl
+, scipy
 , six
-, colorcet
 , unidecode
 , urllib3
+, wget
+, deepdiff
+, pytestCheckHook
+, pytestcov
+, websocket_client
 }:
 
 buildPythonPackage rec {
   pname = "runway-python";
   version = "0.6.1";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "66cf1517dd817bf6db3792608920274f964dd0ced8dabecd925b8bc17aa95740";
+  src = fetchFromGitHub {
+    owner = "runwayml";
+    repo = "model-sdk";
+    rev = version;
+    sha256 = "1ww2wai1qnly8i7g42vhkkbs4yp7wi9x4fjdxsg9fl3izjra0zs2";
   };
 
   propagatedBuildInputs = [
     colorcet
+    cryptography
     flask
     flask-compress
     flask-cors
@@ -36,6 +46,7 @@ buildPythonPackage rec {
     imageio
     numpy
     pillow
+    pyopenssl
     scipy
     six
     unidecode
@@ -43,13 +54,30 @@ buildPythonPackage rec {
     wget
   ];
 
-  # tests are not packaged in the released tarball
-  doCheck = false;
-
   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";