2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2021-05-20 23:08:51 +00:00
|
|
|
, pythonAtLeast
|
|
|
|
, fetchFromGitHub
|
|
|
|
, colorcet
|
|
|
|
, cryptography
|
2020-04-24 23:36:52 +00:00
|
|
|
, flask
|
|
|
|
, flask-compress
|
|
|
|
, flask-cors
|
|
|
|
, flask-sockets
|
2021-05-20 23:08:51 +00:00
|
|
|
, gevent
|
2020-09-25 04:45:31 +00:00
|
|
|
, imageio
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
|
|
|
, pillow
|
2021-05-20 23:08:51 +00:00
|
|
|
, pyopenssl
|
|
|
|
, scipy
|
2020-04-24 23:36:52 +00:00
|
|
|
, six
|
|
|
|
, unidecode
|
|
|
|
, urllib3
|
2021-05-20 23:08:51 +00:00
|
|
|
, wget
|
|
|
|
, deepdiff
|
2021-07-24 12:14:16 +00:00
|
|
|
, pytest-cov
|
2022-10-21 18:38:19 +00:00
|
|
|
, pytestCheckHook
|
2021-08-10 14:31:46 +00:00
|
|
|
, pythonOlder
|
2021-06-28 23:13:55 +00:00
|
|
|
, websocket-client
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "runway-python";
|
2020-12-26 04:20:00 +00:00
|
|
|
version = "0.6.1";
|
2022-10-21 18:38:19 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "runwayml";
|
|
|
|
repo = "model-sdk";
|
|
|
|
rev = version;
|
2022-10-21 18:38:19 +00:00
|
|
|
hash = "sha256-Qn+gsvxxUJee7k060lPk53qi15xwC/JORJ5aHKLigvM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
colorcet
|
2021-05-20 23:08:51 +00:00
|
|
|
cryptography
|
2020-09-25 04:45:31 +00:00
|
|
|
flask
|
|
|
|
flask-compress
|
|
|
|
flask-cors
|
|
|
|
flask-sockets
|
|
|
|
gevent
|
|
|
|
imageio
|
|
|
|
numpy
|
|
|
|
pillow
|
2021-05-20 23:08:51 +00:00
|
|
|
pyopenssl
|
2020-09-25 04:45:31 +00:00
|
|
|
scipy
|
|
|
|
six
|
|
|
|
unidecode
|
|
|
|
urllib3
|
|
|
|
wget
|
2022-10-21 18:38:19 +00:00
|
|
|
] ++ urllib3.optional-dependencies.secure;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
deepdiff
|
2021-07-24 12:14:16 +00:00
|
|
|
pytest-cov
|
2022-10-21 18:38:19 +00:00
|
|
|
pytestCheckHook
|
2021-06-28 23:13:55 +00:00
|
|
|
websocket-client
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Build fails with:
|
|
|
|
# ERROR: No matching distribution found for urllib3-secure-extra; extra == "secure"
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace "urllib3[secure]>=1.25.7" "urllib3"
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTests = [
|
2022-10-21 18:38:19 +00:00
|
|
|
# These tests require network
|
2021-05-20 23:08:51 +00:00
|
|
|
"test_file_deserialization_remote"
|
|
|
|
"test_file_deserialization_absolute_directory"
|
|
|
|
"test_file_deserialization_remote_directory"
|
2021-08-10 14:31:46 +00:00
|
|
|
# Fails with a decoding error at the moment
|
|
|
|
"test_inference_async"
|
2021-05-20 23:08:51 +00:00
|
|
|
] ++ lib.optionals (pythonAtLeast "3.9") [
|
2022-10-21 18:38:19 +00:00
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"runway"
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|