about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/smart-open/default.nix
blob: 53aa2d76f6aa4897e43b86a537197cc8f3cf3884 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, azure-common
, azure-core
, azure-storage-blob
, boto3
, google-cloud-storage
, requests
, moto
, paramiko
, pytestCheckHook
, responses
, setuptools
, wrapt
, zstandard
}:

buildPythonPackage rec {
  pname = "smart-open";
  version = "7.0.1";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "RaRe-Technologies";
    repo = "smart_open";
    rev = "refs/tags/v${version}";
    hash = "sha256-yGy4xNoHCE+LclBBTMVtTKP6GYZ5w09NJ0OmsUPnir4=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    wrapt
  ];

  optional-dependencies = {
    s3 = [
      boto3
    ];
    gcs = [
      google-cloud-storage
    ];
    azure = [
      azure-storage-blob
      azure-common
      azure-core
    ];
    http = [
      requests
    ];
    webhdfs = [
      requests
    ];
    ssh = [
      paramiko
    ];
    zst = [
      zstandard
    ];
  };

  pythonImportsCheck = [
    "smart_open"
  ];

  nativeCheckInputs = [
    moto
    pytestCheckHook
    responses
  ] ++ lib.flatten (builtins.attrValues optional-dependencies);

  pytestFlagsArray = [
    "smart_open"
  ];

  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"
  ];

  meta = with lib; {
    description = "Library for efficient streaming of very large file";
    homepage = "https://github.com/RaRe-Technologies/smart_open";
    license = licenses.mit;
    maintainers = with maintainers; [ jyp ];
  };
}