about summary refs log tree commit diff
path: root/pkgs/development/python-modules/spacy/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/spacy/default.nix')
-rw-r--r--pkgs/development/python-modules/spacy/default.nix53
1 files changed, 25 insertions, 28 deletions
diff --git a/pkgs/development/python-modules/spacy/default.nix b/pkgs/development/python-modules/spacy/default.nix
index b94374aeda86..16c1841a3d62 100644
--- a/pkgs/development/python-modules/spacy/default.nix
+++ b/pkgs/development/python-modules/spacy/default.nix
@@ -1,11 +1,11 @@
-{ stdenv
+{ lib
 , pkgs
 , buildPythonPackage
 , python
 , fetchPypi
+, pythonOlder
 , html5lib
 , pytest
-, cython
 , preshed
 , ftfy
 , numpy
@@ -16,8 +16,11 @@
 , dill
 , requests
 , thinc
-, pip
 , regex
+, cymem
+, pathlib
+, msgpack-python
+, msgpack-numpy
 }:
 
 buildPythonPackage rec {
@@ -30,38 +33,32 @@ buildPythonPackage rec {
   };
 
   prePatch = ''
-    substituteInPlace setup.py --replace \
-      "'html5lib==1.0b8'," \
-      "'html5lib',"
-
-    substituteInPlace setup.py --replace \
-      "'regex==2017.4.5'," \
-      "'regex',"
-
-    substituteInPlace setup.py --replace \
-      "'ftfy==2017.4.5'," \
-      "'ftfy',"
-
-    substituteInPlace setup.py --replace \
-      "'pathlib'," \
-      "\"pathlib; python_version<'3.4'\","
+    substituteInPlace setup.py \
+      --replace "html5lib==" "html5lib>=" \
+      --replace "regex==" "regex>=" \
+      --replace "ftfy==" "ftfy>=" \
+      --replace "msgpack-python==" "msgpack-python>=" \
+      --replace "msgpack-numpy==" "msgpack-numpy>=" \
+      --replace "pathlib" "pathlib; python_version<\"3.4\""
   '';
 
   propagatedBuildInputs = [
-   cython
-   dill
-   html5lib
-   murmurhash
    numpy
-   plac
+   murmurhash
+   cymem
    preshed
-   regex
-   requests
-   six
    thinc
+   plac
+   six
+   html5lib
    ujson
+   dill
+   requests
+   regex
    ftfy
-  ];
+   msgpack-python
+   msgpack-numpy
+  ] ++ lib.optional (pythonOlder "3.4") pathlib;
 
   checkInputs = [
     pytest
@@ -72,7 +69,7 @@ buildPythonPackage rec {
   #   ${python.interpreter} -m pytest spacy/tests --vectors --models --slow
   # '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Industrial-strength Natural Language Processing (NLP) with Python and Cython";
     homepage = https://github.com/explosion/spaCy;
     license = licenses.mit;