315a71f2ff
This commit was automatically generated using update-python-libraries.
70 lines
1.4 KiB
Nix
70 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchPypi,
|
|
pytestCheckHook,
|
|
ctranslate2,
|
|
ctranslate2-cpp,
|
|
sacremoses,
|
|
sentencepiece,
|
|
setuptools,
|
|
spacy,
|
|
stanza,
|
|
}:
|
|
let
|
|
ctranslate2OneDNN = ctranslate2.override {
|
|
ctranslate2-cpp = ctranslate2-cpp.override {
|
|
# https://github.com/OpenNMT/CTranslate2/issues/1294
|
|
withOneDNN = true;
|
|
withOpenblas = false;
|
|
};
|
|
};
|
|
in
|
|
buildPythonPackage rec {
|
|
pname = "argostranslate";
|
|
version = "1.10.0";
|
|
pyproject = true;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-I38L2u9aRareA0rHEsHQwY/UKIf8CBQYCNyt3nv9H2c=";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
ctranslate2OneDNN
|
|
sacremoses
|
|
sentencepiece
|
|
spacy
|
|
stanza
|
|
];
|
|
|
|
postPatch = ''
|
|
ln -s */requires.txt requirements.txt
|
|
|
|
substituteInPlace requirements.txt \
|
|
--replace "==" ">="
|
|
'';
|
|
|
|
doCheck = false; # needs network access
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
# required for import check to work
|
|
# PermissionError: [Errno 13] Permission denied: '/homeless-shelter'
|
|
env.HOME = "/tmp";
|
|
|
|
pythonImportsCheck = [
|
|
"argostranslate"
|
|
"argostranslate.translate"
|
|
];
|
|
|
|
meta = {
|
|
description = "Open-source offline translation library written in Python";
|
|
homepage = "https://www.argosopentech.com";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ misuzu ];
|
|
};
|
|
}
|