nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 deprecated,
6 hopcroftkarp,
7 joblib,
8 matplotlib,
9 numpy,
10 scikit-learn,
11 scipy,
12 pytestCheckHook,
13}:
14
15buildPythonPackage rec {
16 pname = "persim";
17 version = "0.3.8";
18 format = "setuptools";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-4T0YWEF2uKdk0W1+Vt8I3Mi6ZsazJXoHI0W+O9WbpA0=";
23 };
24
25 propagatedBuildInputs = [
26 deprecated
27 hopcroftkarp
28 joblib
29 matplotlib
30 numpy
31 scikit-learn
32 scipy
33 ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 preCheck = ''
38 # specifically needed for darwin
39 export HOME=$(mktemp -d)
40 mkdir -p $HOME/.matplotlib
41 echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
42 '';
43
44 pythonImportsCheck = [ "persim" ];
45
46 disabledTests = [
47 # AttributeError: module 'collections' has no attribute 'Iterable'
48 "test_empyt_diagram_list"
49 "test_empty_diagram_list"
50 "test_fit_diagram"
51 "test_integer_diagrams"
52 "test_lists_of_lists"
53 "test_mixed_pairs"
54 "test_multiple_diagrams"
55 "test_n_pixels"
56 # https://github.com/scikit-tda/persim/issues/67
57 "test_persistenceimager"
58 # ValueError: setting an array element with a sequence
59 "test_exact_critical_pairs"
60 ];
61
62 meta = {
63 description = "Distances and representations of persistence diagrams";
64 homepage = "https://persim.scikit-tda.org";
65 changelog = "https://github.com/scikit-tda/persim/releases/tag/v${version}";
66 license = lib.licenses.mit;
67 maintainers = [ ];
68 };
69}