1{ lib 2, stdenv 3, fetchPypi 4, fetchpatch 5, buildPythonPackage 6, isPy3k 7, rustPlatform 8, setuptools-rust 9, libiconv 10}: 11 12buildPythonPackage rec { 13 pname = "spacy-alignments"; 14 version = "0.8.4"; 15 16 disabled = !isPy3k; 17 18 src = fetchPypi { 19 inherit pname version; 20 sha256 = "sha256-1HApl/RZ0w5Tf2OPu1QBUa36uIqilp+dDbPjujn0e9s="; 21 }; 22 23 cargoDeps = rustPlatform.fetchCargoTarball { 24 inherit src; 25 name = "${pname}-${version}"; 26 sha256 = "sha256-oFSruBnoodv6/0/OrmJ/2SVoWm3u3FGtzVJ9xgp0+Cg="; 27 }; 28 29 nativeBuildInputs = [ 30 setuptools-rust 31 ] ++ (with rustPlatform; [ 32 cargoSetupHook 33 rust.cargo 34 rust.rustc 35 ]); 36 37 buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; 38 39 # Fails because spacy_alignments module cannot be loaded correctly. 40 doCheck = false; 41 42 pythonImportsCheck = [ "spacy_alignments" ]; 43 44 meta = with lib; { 45 description = "Align tokenizations for spaCy and transformers"; 46 homepage = "https://github.com/explosion/spacy-alignments"; 47 license = licenses.mit; 48 maintainers = with maintainers; [ ]; 49 }; 50}