Files
nixpkgs/pkgs/development/python-modules/fugashi/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

62 lines
1.2 KiB
Nix

{
lib,
fetchFromGitHub,
pytestCheckHook,
buildPythonPackage,
cython,
mecab,
setuptools-scm,
ipadic,
unidic,
unidic-lite,
}:
buildPythonPackage rec {
pname = "fugashi";
version = "1.5.1";
pyproject = true;
src = fetchFromGitHub {
owner = "polm";
repo = "fugashi";
tag = "v${version}";
hash = "sha256-rkQskRz7lgVBrqBeyj9kWO2/7POrZ0TaM+Z7mhpZLvM=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "Cython~=3.0.11" "Cython"
'';
build-system = [
cython
mecab
setuptools-scm
];
nativeCheckInputs = [
ipadic
pytestCheckHook
]
++ optional-dependencies.unidic-lite;
optional-dependencies = {
unidic-lite = [ unidic-lite ];
unidic = [ unidic ];
};
preCheck = ''
cd fugashi
'';
pythonImportsCheck = [ "fugashi" ];
meta = {
description = "Cython MeCab wrapper for fast, pythonic Japanese tokenization and morphological analysis";
homepage = "https://github.com/polm/fugashi";
changelog = "https://github.com/polm/fugashi/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ laurent-f1z1 ];
};
}