504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
51 lines
1 KiB
Nix
51 lines
1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, cargo
|
|
, fetchPypi
|
|
, buildPythonPackage
|
|
, isPy3k
|
|
, rustPlatform
|
|
, rustc
|
|
, setuptools-rust
|
|
, libiconv
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "spacy-alignments";
|
|
version = "0.9.0";
|
|
format = "setuptools";
|
|
|
|
disabled = !isPy3k;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-jcNYghWR9Xbu97/hAYe8ewa5oMQ4ofNGFwY4cY7/EmM=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
inherit src;
|
|
name = "${pname}-${version}";
|
|
hash = "sha256-I5uI+qFyb4/ArpUZi4yS/E/bmwoW7+CalMq02Gnm9S8=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
setuptools-rust
|
|
rustPlatform.cargoSetupHook
|
|
cargo
|
|
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;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
}
|