nixpkgs/pkgs/development/python-modules/attacut/default.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

74 lines
1.4 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";
rev = "refs/tags/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 ];
pytestFlagsArray = [ "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";
};
}