1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, boto
6, boto3
7, bz2file
8, mock
9, moto
10, requests
11, responses
12}:
13
14buildPythonPackage rec {
15 pname = "smart_open";
16 version = "2.1.1";
17 disabled = pythonOlder "3.5";
18
19 src = fetchPypi {
20 inherit pname version;
21 sha256 = "51b05acd85ec007e1d4dcdbf2bbf917218a45026f37d559559401114bb5e5840";
22 };
23
24 # nixpkgs version of moto is >=1.2.0, remove version pin to fix build
25 postPatch = ''
26 substituteInPlace ./setup.py --replace "moto==0.4.31" "moto"
27 '';
28
29 # moto>=1.0.0 is backwards-incompatible and some tests fail with it,
30 # so disable tests for now
31 doCheck = false;
32
33 checkInputs = [ mock moto responses ];
34
35 # upstream code requires both boto and boto3
36 propagatedBuildInputs = [ boto boto3 bz2file requests ];
37 meta = {
38 license = lib.licenses.mit;
39 description = "smart_open is a Python 2 & Python 3 library for efficient streaming of very large file";
40 maintainers = with lib.maintainers; [ jyp ];
41 };
42}