1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, azure-common
6, azure-core
7, azure-storage-blob
8, boto3
9, google-cloud-storage
10, requests
11, moto
12, paramiko
13, pytestCheckHook
14, responses
15}:
16
17buildPythonPackage rec {
18 pname = "smart-open";
19 version = "6.4.0";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.6";
23
24 src = fetchFromGitHub {
25 owner = "RaRe-Technologies";
26 repo = "smart_open";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-fciNaVw603FAcgrSrND+LEycJffmnFQij2ZpatYZ/e4=";
29 };
30
31 passthru.optional-dependencies = {
32 s3 = [
33 boto3
34 ];
35 gcs = [
36 google-cloud-storage
37 ];
38 azure = [
39 azure-storage-blob
40 azure-common
41 azure-core
42 ];
43 http = [
44 requests
45 ];
46 webhdfs = [
47 requests
48 ];
49 ssh = [
50 paramiko
51 ];
52 };
53
54 pythonImportsCheck = [
55 "smart_open"
56 ];
57
58 nativeCheckInputs = [
59 moto
60 pytestCheckHook
61 responses
62 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
63
64 pytestFlagsArray = [
65 "smart_open"
66 ];
67
68 disabledTests = [
69 # https://github.com/RaRe-Technologies/smart_open/issues/784
70 "test_https_seek_forward"
71 "test_seek_from_current"
72 "test_seek_from_end"
73 "test_seek_from_start"
74 ];
75
76 meta = with lib; {
77 description = "Library for efficient streaming of very large file";
78 homepage = "https://github.com/RaRe-Technologies/smart_open";
79 license = licenses.mit;
80 maintainers = with maintainers; [ jyp ];
81 };
82}