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