nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 poetry-core,
9 poetry-dynamic-versioning,
10
11 # dependencies
12 anytree,
13 beartype,
14 future,
15 gensim,
16 graspologic-native,
17 hyppo,
18 joblib,
19 matplotlib,
20 networkx,
21 numpy,
22 pot,
23 scikit-learn,
24 scipy,
25 seaborn,
26 statsmodels,
27 typing-extensions,
28 umap-learn,
29
30 # tests
31 pytestCheckHook,
32 testfixtures,
33}:
34
35buildPythonPackage rec {
36 pname = "graspologic";
37 version = "3.4.4";
38 pyproject = true;
39
40 src = fetchFromGitHub {
41 owner = "graspologic-org";
42 repo = "graspologic";
43 tag = "v${version}";
44 hash = "sha256-ulsb7jD/tIVEISjnNRif7VO+ZcXCAGIFl1SNZhOC7ik=";
45 };
46
47 # Fix numpy 2 compat
48 postPatch = ''
49 substituteInPlace graspologic/utils/utils.py \
50 --replace-fail "np.float_" "np.float64"
51 substituteInPlace graspologic/embed/omni.py \
52 --replace-fail \
53 "A = np.array(graphs, copy=False, ndmin=3)" \
54 "A = np.asarray(graphs)"
55 '';
56
57 build-system = [
58 poetry-core
59 poetry-dynamic-versioning
60 ];
61
62 pythonRelaxDeps = [
63 "beartype"
64 "hyppo"
65 "numpy"
66 "scipy"
67 ];
68
69 dependencies = [
70 anytree
71 beartype
72 future
73 gensim
74 graspologic-native
75 hyppo
76 joblib
77 matplotlib
78 networkx
79 numpy
80 pot
81 scikit-learn
82 scipy
83 seaborn
84 statsmodels
85 typing-extensions
86 umap-learn
87 ];
88
89 env.NUMBA_CACHE_DIR = "$TMPDIR";
90
91 nativeCheckInputs = [
92 pytestCheckHook
93 testfixtures
94 ];
95
96 enabledTestPaths = [
97 "tests"
98 ];
99
100 disabledTests = [ "gridplot_outputs" ];
101
102 disabledTestPaths = [
103 "docs"
104 ]
105 ++ lib.optionals stdenv.hostPlatform.isDarwin [
106 # SIGABRT
107 "tests/test_plot.py"
108 "tests/test_plot_matrix.py"
109
110 # Hang forever
111 "tests/pipeline/embed/"
112 ];
113
114 meta = {
115 description = "Package for graph statistical algorithms";
116 homepage = "https://graspologic-org.github.io/graspologic";
117 changelog = "https://github.com/graspologic-org/graspologic/releases/tag/${src.tag}";
118 license = lib.licenses.mit;
119 maintainers = with lib.maintainers; [ bcdarwin ];
120 };
121}