1{
2 lib,
3 buildPythonPackage,
4 deprecated,
5 fetchFromGitea,
6 importlib-resources,
7 jaconv,
8 py-cpuinfo,
9 pytest-benchmark,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools-scm,
13}:
14
15buildPythonPackage rec {
16 pname = "pykakasi";
17 version = "2.3.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitea {
23 domain = "codeberg.org";
24 owner = "miurahr";
25 repo = "pykakasi";
26 rev = "refs/tags/v${version}";
27 hash = "sha256-b2lYYdg1RW1xRD3hym7o1EnxzN/U5txVTWRifwZn3k0=";
28 };
29
30 build-system = [ setuptools-scm ];
31
32 dependencies = [
33 jaconv
34 deprecated
35 ]
36 ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ];
37
38 nativeCheckInputs = [
39 py-cpuinfo
40 pytest-benchmark
41 pytestCheckHook
42 ];
43
44 disabledTests = [
45 # Assertion error
46 "test_aozora"
47 ];
48
49 pytestFlags = [ "--benchmark-disable" ];
50
51 pythonImportsCheck = [ "pykakasi" ];
52
53 meta = with lib; {
54 description = "Python converter for Japanese Kana-kanji sentences into Kana-Roman";
55 homepage = "https://codeberg.org/miurahr/pykakasi";
56 changelog = "https://codeberg.org/miurahr/pykakasi/src/tag/v${version}/CHANGELOG.rst";
57 license = licenses.gpl3Plus;
58 maintainers = with maintainers; [ fab ];
59 mainProgram = "kakasi";
60 };
61}