Files
nixpkgs/pkgs/development/python-modules/attacut/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

74 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
setuptools,
pytestCheckHook,
docopt,
fire,
numpy,
python-crfsuite,
pyyaml,
six,
ssg,
torch,
}:
buildPythonPackage rec {
pname = "attacut";
version = "1.1.0-dev";
pyproject = true;
src = fetchFromGitHub {
owner = "PyThaiNLP";
repo = "attacut";
tag = "v${version}";
hash = "sha256-x3JJC1Xd+tsOAHJEHGzIrhIrNGSvLSanAFc7+uXb2Kk=";
};
# no more need, see patch...
postPatch = ''
sed -i "/nptyping>=/d" setup.py
'';
patches = [
(fetchpatch {
name = "fix-nptyping-deprecated-array.patch";
url = "https://github.com/PyThaiNLP/attacut/commit/a707297b3f08a015d32d8ac241aa8cb11128cbd4.patch";
includes = [ "attacut/evaluation.py" ];
hash = "sha256-k2DJPwiH1Fyf5u6+zavx0bankCXsJVZrw1MGcf8ZL+M=";
})
];
build-system = [ setuptools ];
dependencies = [
docopt
fire
numpy
python-crfsuite
pyyaml
six
ssg
torch
];
nativeCheckInputs = [ pytestCheckHook ];
enabledTestPaths = [ "tests/*" ];
pythonImportsCheck = [ "attacut" ];
meta = with lib; {
description = "Fast and Accurate Neural Thai Word Segmenter";
homepage = "https://github.com/PyThaiNLP/attacut";
license = licenses.mit;
maintainers = with maintainers; [ vizid ];
mainProgram = "attacut-cli";
};
}