summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/doublemetaphone/default.nix
blob: a5fe45fea786c5e7df979979e2fbea8b6252bdb2 (plain)
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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  cython,
  setuptools,

  # tests
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "doublemetaphone";
  version = "1.2i";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "dedupeio";
    repo = "doublemetaphone";
    tag = "v${version}";
    hash = "sha256-VPJqHxQHLiLSko+aJYTIgISluHPARgQN5pYWYxP9QKQ=";
  };

  build-system = [
    cython
    setuptools
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  # Prevent importing from source during test collection (only $out has compiled extensions)
  preCheck = ''
    rm -rf doublemetaphone
  '';

  pythonImportsCheck = [
    "doublemetaphone"
  ];

  meta = {
    description = "Python wrapper for Double Metaphone phonetic encoding algorithm";
    homepage = "https://github.com/dedupeio/doublemetaphone";
    license = lib.licenses.artistic1;
    maintainers = with lib.maintainers; [ daniel-fahey ];
  };
}