python3Packages.runway-python: fix build, enable tests

This commit is contained in:
Martin Weinelt 2021-05-07 20:25:29 +02:00 committed by Jonathan Ringer
parent 5ae90276c3
commit 12493f272b

View File

@ -1,33 +1,43 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchPypi , pythonAtLeast
, fetchFromGitHub
, colorcet
, cryptography
, flask , flask
, flask-compress , flask-compress
, flask-cors , flask-cors
, flask-sockets , flask-sockets
, gevent
, imageio , imageio
, numpy , numpy
, scipy
, pillow , pillow
, gevent , pyopenssl
, wget , scipy
, six , six
, colorcet
, unidecode , unidecode
, urllib3 , urllib3
, wget
, deepdiff
, pytestCheckHook
, pytestcov
, websocket_client
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "runway-python"; pname = "runway-python";
version = "0.6.1"; version = "0.6.1";
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "runwayml";
sha256 = "66cf1517dd817bf6db3792608920274f964dd0ced8dabecd925b8bc17aa95740"; repo = "model-sdk";
rev = version;
sha256 = "1ww2wai1qnly8i7g42vhkkbs4yp7wi9x4fjdxsg9fl3izjra0zs2";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
colorcet colorcet
cryptography
flask flask
flask-compress flask-compress
flask-cors flask-cors
@ -36,6 +46,7 @@ buildPythonPackage rec {
imageio imageio
numpy numpy
pillow pillow
pyopenssl
scipy scipy
six six
unidecode unidecode
@ -43,13 +54,30 @@ buildPythonPackage rec {
wget wget
]; ];
# tests are not packaged in the released tarball
doCheck = false;
pythonImportsCheck = [ pythonImportsCheck = [
"runway" "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 = { meta = {
description = "Helper library for creating Runway models"; description = "Helper library for creating Runway models";
homepage = "https://github.com/runwayml/model-sdk"; homepage = "https://github.com/runwayml/model-sdk";