summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyhacrf-datamade/default.nix
blob: db850e5809ff87965289380ed19014776d6349cc (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  unstableGitUpdater,

  # build-system
  cython,
  numpy,
  setuptools,

  # dependencies
  dedupe-pylbfgs,

  # tests
  pytestCheckHook,
}:

buildPythonPackage {
  pname = "pyhacrf-datamade";
  # Tagged release requested upstream in https://github.com/dedupeio/pyhacrf/issues/57
  version = "0.2.8-unstable-2025-05-16";
  pyproject = true;

  # NOTE: This is a fork of dirko/pyhacrf maintained by dedupeio
  src = fetchFromGitHub {
    owner = "dedupeio";
    repo = "pyhacrf";
    rev = "899aa6c2c48e5afe8fb40727ffd6070e4ba71c31";
    hash = "sha256-MVkOChDblu7A/ve51SYqO7lNoTXwh37bHjnZd+NvzK0=";
  };

  build-system = [
    cython
    numpy
    setuptools
  ];

  dependencies = [
    dedupe-pylbfgs
    numpy
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  # Change to temp directory so pytest imports from installed package in $out, not source
  preCheck = ''
    export TEST_DIR=$(mktemp -d)
    cp -r pyhacrf/tests $TEST_DIR/
    pushd $TEST_DIR
  '';

  postCheck = ''
    popd
  '';

  pythonImportsCheck = [
    "pyhacrf"
  ];

  passthru.updateScript = unstableGitUpdater { };

  meta = {
    description = "Hidden alignment conditional random field for classifying string pairs";
    homepage = "https://github.com/dedupeio/pyhacrf";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ daniel-fahey ];
  };
}