2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchPypi
|
|
|
|
, fetchpatch
|
|
|
|
, buildPythonPackage
|
|
|
|
, isPy3k
|
|
|
|
, rustPlatform
|
|
|
|
, setuptools-rust
|
|
|
|
, libiconv
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "spacy-alignments";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "0.8.4";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "sha256-1HApl/RZ0w5Tf2OPu1QBUa36uIqilp+dDbPjujn0e9s=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
2021-12-26 17:43:05 +00:00
|
|
|
inherit src;
|
2021-05-20 23:08:51 +00:00
|
|
|
name = "${pname}-${version}";
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "sha256-oFSruBnoodv6/0/OrmJ/2SVoWm3u3FGtzVJ9xgp0+Cg=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-rust
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
rust.cargo
|
|
|
|
rust.rustc
|
|
|
|
]);
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
|
|
|
|
|
|
|
# Fails because spacy_alignments module cannot be loaded correctly.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "spacy_alignments" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Align tokenizations for spaCy and transformers";
|
|
|
|
homepage = "https://github.com/explosion/spacy-alignments";
|
|
|
|
license = licenses.mit;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|