1{ lib
2, buildPythonPackage
3, cython
4, fetchPypi
5, numpy
6, persim
7, pytestCheckHook
8, pythonOlder
9, scikit-learn
10, scipy
11}:
12
13buildPythonPackage rec {
14 pname = "ripser";
15 version = "0.6.4";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-eps+lCCGnFDfhemkRskSuK+BYh5iyhr4+UksYzW35ZQ=";
23 };
24
25 nativeBuildInputs = [
26 cython
27 ];
28
29 propagatedBuildInputs = [
30 numpy
31 scipy
32 scikit-learn
33 persim
34 ];
35
36 nativeCheckInputs = [
37 pytestCheckHook
38 ];
39
40 preCheck = ''
41 # specifically needed for darwin
42 export HOME=$(mktemp -d)
43 mkdir -p $HOME/.matplotlib
44 echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
45 '';
46
47 pythonImportsCheck = [
48 "ripser"
49 ];
50
51 meta = with lib; {
52 description = "A Lean Persistent Homology Library for Python";
53 homepage = "https://ripser.scikit-tda.org";
54 changelog = "https://github.com/scikit-tda/ripser.py/blob/${version}/CHANGELOG.md";
55 license = licenses.mit;
56 maintainers = with maintainers; [ ];
57 };
58}