1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, setuptools
5, cython
6, hypothesis
7, numpy
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "blis";
14 version = "0.7.11";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "explosion";
21 repo = "cython-blis";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-p8pzGZc5OiiGTvXULDgzsBC3jIhovTKUq3RtPnQ/+to=";
24 };
25
26 postPatch = ''
27 # See https://github.com/numpy/numpy/issues/21079
28 # has no functional difference as the name is only used in log output
29 substituteInPlace blis/benchmark.py \
30 --replace 'numpy.__config__.blas_ilp64_opt_info["libraries"]' '["dummy"]'
31 '';
32
33 preCheck = ''
34 # remove src module, so tests use the installed module instead
35 rm -rf ./blis
36 '';
37
38 nativeBuildInputs = [
39 setuptools
40 cython
41 ];
42
43 propagatedBuildInputs = [
44 numpy
45 ];
46
47 nativeCheckInputs = [
48 hypothesis
49 pytestCheckHook
50 ];
51
52 pythonImportsCheck = [
53 "blis"
54 ];
55
56 passthru = {
57 # Do not update to BLIS 0.9.x until the following issue is resolved:
58 # https://github.com/explosion/thinc/issues/771#issuecomment-1255825935
59 skipBulkUpdate = true;
60 };
61
62 meta = with lib; {
63 description = "BLAS-like linear algebra library";
64 homepage = "https://github.com/explosion/cython-blis";
65 license = licenses.bsd3;
66 maintainers = with maintainers; [ nickcao ];
67 };
68}