2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
azure-common,
|
|
|
|
azure-core,
|
|
|
|
azure-storage-blob,
|
|
|
|
boto3,
|
|
|
|
google-cloud-storage,
|
|
|
|
requests,
|
|
|
|
moto,
|
|
|
|
paramiko,
|
|
|
|
pytestCheckHook,
|
|
|
|
responses,
|
|
|
|
setuptools,
|
|
|
|
wrapt,
|
|
|
|
zstandard,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-05-28 09:39:13 +00:00
|
|
|
pname = "smart-open";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "7.0.4";
|
|
|
|
pyproject = true;
|
2021-07-21 07:28:18 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RaRe-Technologies";
|
|
|
|
repo = "smart_open";
|
2022-12-17 10:02:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-4HOTaF6AKXGlVCvSGKnnaH73aa4IO0aRxz03XQ4gSd8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/RaRe-Technologies/smart_open/pull/822
|
|
|
|
# fix test_smart_open.py on python 3.12
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-smart-open-test.patch";
|
|
|
|
url = "https://github.com/RaRe-Technologies/smart_open/commit/3d29564ca034a56d343c9d14b178aaa0ff4c937c.patch";
|
|
|
|
hash = "sha256-CrAeqaIMM8bctWiFnq9uamnIlkaslDyjaWL6k9wUjT8=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dependencies = [ wrapt ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
s3 = [ boto3 ];
|
|
|
|
gcs = [ google-cloud-storage ];
|
2023-11-16 04:20:00 +00:00
|
|
|
azure = [
|
|
|
|
azure-storage-blob
|
|
|
|
azure-common
|
|
|
|
azure-core
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
http = [ requests ];
|
|
|
|
webhdfs = [ requests ];
|
|
|
|
ssh = [ paramiko ];
|
|
|
|
zst = [ zstandard ];
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "smart_open" ];
|
2021-07-21 07:28:18 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-07-21 07:28:18 +00:00
|
|
|
moto
|
|
|
|
pytestCheckHook
|
2023-11-16 04:20:00 +00:00
|
|
|
responses
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues optional-dependencies);
|
2021-07-21 07:28:18 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "smart_open" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
disabledTests = [
|
|
|
|
# https://github.com/RaRe-Technologies/smart_open/issues/784
|
|
|
|
"test_https_seek_forward"
|
|
|
|
"test_seek_from_current"
|
|
|
|
"test_seek_from_end"
|
|
|
|
"test_seek_from_start"
|
2021-07-21 07:28:18 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
meta = with lib; {
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://github.com/piskvorky/smart_open/releases/tag/v${version}";
|
2021-05-28 09:39:13 +00:00
|
|
|
description = "Library for efficient streaming of very large file";
|
2021-07-21 07:28:18 +00:00
|
|
|
homepage = "https://github.com/RaRe-Technologies/smart_open";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jyp ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|