aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/smart_open
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/smart_open')
-rw-r--r--nixpkgs/pkgs/development/python-modules/smart_open/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/smart_open/default.nix b/nixpkgs/pkgs/development/python-modules/smart_open/default.nix
new file mode 100644
index 00000000000..48cfcb132f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/smart_open/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, boto
+, boto3
+, bz2file
+, mock
+, moto
+, requests
+, responses
+}:
+
+buildPythonPackage rec {
+ pname = "smart_open";
+ version = "1.9.0";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "0xmnp8ywakwg3y21gqdvjw8a4v42vaxfq6njqizzllm4c9g2nk76";
+ };
+
+ # nixpkgs version of moto is >=1.2.0, remove version pin to fix build
+ postPatch = ''
+ substituteInPlace ./setup.py --replace "moto==0.4.31" "moto"
+ '';
+
+ # moto>=1.0.0 is backwards-incompatible and some tests fail with it,
+ # so disable tests for now
+ doCheck = false;
+
+ checkInputs = [ mock moto responses ];
+
+ # upstream code requires both boto and boto3
+ propagatedBuildInputs = [ boto boto3 bz2file requests ];
+ meta = {
+ license = lib.licenses.mit;
+ description = "smart_open is a Python 2 & Python 3 library for efficient streaming of very large file";
+ maintainers = with lib.maintainers; [ jyp ];
+ };
+}