about summary refs log tree commit diff
path: root/pkgs/development/python-modules/blis/default.nix
blob: 91e443af460f756257a2d85b074800670bbbc67a (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
67
68
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools
, cython
, hypothesis
, numpy
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
  pname = "blis";
  version = "0.7.11";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "explosion";
    repo = "cython-blis";
    rev = "refs/tags/v${version}";
    hash = "sha256-p8pzGZc5OiiGTvXULDgzsBC3jIhovTKUq3RtPnQ/+to=";
  };

  postPatch = ''
    # See https://github.com/numpy/numpy/issues/21079
    # has no functional difference as the name is only used in log output
    substituteInPlace blis/benchmark.py \
      --replace 'numpy.__config__.blas_ilp64_opt_info["libraries"]' '["dummy"]'
  '';

  preCheck = ''
    # remove src module, so tests use the installed module instead
    rm -rf ./blis
  '';

  nativeBuildInputs = [
    setuptools
    cython
  ];

  propagatedBuildInputs = [
    numpy
  ];

  nativeCheckInputs = [
    hypothesis
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "blis"
  ];

  passthru = {
    # Do not update to BLIS 0.9.x until the following issue is resolved:
    # https://github.com/explosion/thinc/issues/771#issuecomment-1255825935
    skipBulkUpdate = true;
  };

  meta = with lib; {
    description = "BLAS-like linear algebra library";
    homepage = "https://github.com/explosion/cython-blis";
    license = licenses.bsd3;
    maintainers = with maintainers; [ nickcao ];
  };
}