about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pykakasi/default.nix
blob: 30dcee778a9b689f1b0ce5562dc0ca298f147985 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  lib,
  buildPythonPackage,
  deprecated,
  fetchFromGitHub,
  importlib-metadata,
  jaconv,
  py-cpuinfo,
  pytest-benchmark,
  pytestCheckHook,
  pythonOlder,
  setuptools,
  setuptools-scm,
}:

buildPythonPackage rec {
  pname = "pykakasi";
  version = "2.2.1";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "miurahr";
    repo = "pykakasi";
    rev = "refs/tags/v${version}";
    hash = "sha256-ivlenHPD00bxc0c9G368tfTEckOC3vqDB5kMQzHXbVM==";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail ', "klepto"' ""
  '';

  build-system = [ setuptools-scm ];

  dependencies = [
    jaconv
    deprecated
    setuptools
  ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];

  nativeCheckInputs = [
    py-cpuinfo
    pytest-benchmark
    pytestCheckHook
  ];

  disabledTests = [
    # We don't care about benchmarks
    "test_benchmark"
    "pytest_benchmark_update_machine_info"
    "pytest_benchmark_update_json"
  ];

  pythonImportsCheck = [ "pykakasi" ];

  meta = with lib; {
    description = "Python converter for Japanese Kana-kanji sentences into Kana-Roman";
    mainProgram = "kakasi";
    homepage = "https://github.com/miurahr/pykakasi";
    changelog = "https://github.com/miurahr/pykakasi/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}