anchor.diff:  { stdenv
  +, lib
   , pkgs
   , buildPythonPackage
   , fetchPypi
  -, fetchFromGitHub
  +, pythonOlder
   , pytest
   , cython
   , cymem
  +, msgpack-numpy
  +, msgpack-python
   , preshed
   , numpy
   , python
   , murmurhash
  +, pathlib
   , hypothesis
   , tqdm
   , cytoolz
  
positive.code: , dill
  }:
  
  let
    enableDebugging = true;
  
    pathlibLocked = buildPythonPackage rec {
      name = "${pname}-${version}";
      pname = "pathlib";
      version = "1.0.1";
  
      src = fetchPypi {
        inherit pname version;
        sha256 = "17zajiw4mjbkkv6ahp3xf025qglkj0805m9s41c45zryzj6p2h39";
      };
  
      doCheck = false; # fails to import support from test
    };
  in buildPythonPackage rec {
    pname = "thinc";
    version = "6.5.1";
    name = pname + "-" + version;
  
    src = fetchFromGitHub {
      owner = "explosion";
      repo = "thinc";
      rev = "v${version}";
      sha256 = "008kmjsvanh6qgnpvsn3qacfcyprxirxbw4yfd8flyg7mxw793ws";
    };
  
    propagatedBuildInputs = [
     cython
     cymem
     preshed
     numpy
     murmurhash
  
negative.code:    termcolor
     wrapt
     dill
    ] ++ lib.optional (pythonOlder "3.4") pathlib;
  
  
    checkInputs = [
      pytest
    ];
  
    prePatch = ''
      substituteInPlace setup.py --replace \
        "'pathlib>=1.0.0,<2.0.0'," \
        "\"pathlib>=1.0.0,<2.0.0; python_version<'3.4'\","
  
      substituteInPlace setup.py --replace \
        "'cytoolz>=0.8,<0.9'," \
        "'cytoolz>=0.8',"
    '';
  
    # Cannot find cython modules.
    doCheck = false;
  
    checkPhase = ''
      pytest thinc/tests
    '';
  
    meta = with stdenv.lib; {
      description = "Practical Machine Learning for NLP in Python";
      homepage = https://github.com/explosion/thinc;
      license = licenses.mit;
      maintainers = with maintainers; [ aborsu sdll ];
      };
  }
  