Skip to content

Commit c6afce4

Browse files
committed
python312Packages.textnets: fix build on darwin
1 parent 0c87981 commit c6afce4

File tree

1 file changed

+31
-18
lines changed

1 file changed

+31
-18
lines changed

pkgs/development/python-modules/textnets/default.nix

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
{
22
lib,
3+
stdenv,
34
buildPythonPackage,
4-
cairocffi,
5-
cython,
6-
en_core_web_sm,
75
fetchFromGitHub,
6+
7+
# build-system
8+
cython,
9+
poetry-core,
10+
setuptools,
11+
12+
# dependencies
13+
cairocffi,
814
igraph,
915
leidenalg,
1016
pandas,
11-
poetry-core,
1217
pyarrow,
13-
pytestCheckHook,
14-
pythonOlder,
1518
scipy,
16-
setuptools,
17-
spacy-lookups-data,
1819
spacy,
20+
spacy-lookups-data,
1921
toolz,
2022
tqdm,
2123
wasabi,
24+
25+
# tests
26+
en_core_web_sm,
27+
pytestCheckHook,
2228
}:
2329

2430
buildPythonPackage rec {
2531
pname = "textnets";
2632
version = "0.9.5";
2733
pyproject = true;
2834

29-
disabled = pythonOlder "3.9";
30-
3135
src = fetchFromGitHub {
3236
owner = "jboynyc";
3337
repo = "textnets";
@@ -63,8 +67,8 @@ buildPythonPackage rec {
6367
];
6468

6569
nativeCheckInputs = [
66-
pytestCheckHook
6770
en_core_web_sm
71+
pytestCheckHook
6872
];
6973

7074
pythonImportsCheck = [ "textnets" ];
@@ -74,16 +78,25 @@ buildPythonPackage rec {
7478
rm -r textnets
7579
'';
7680

77-
disabledTests = [
78-
# Test fails: Throws a UserWarning asking the user to install `textnets[fca]`.
79-
"test_context"
80-
];
81+
disabledTests =
82+
[
83+
# Test fails: Throws a UserWarning asking the user to install `textnets[fca]`.
84+
"test_context"
85+
]
86+
++ lib.optionals stdenv.hostPlatform.isDarwin [
87+
# MemoryError: ("cairo returned CAIRO_STATUS_NO_MEMORY: b'out of memory'", 1)
88+
"test_plot_backbone"
89+
"test_plot_filtered"
90+
"test_plot_layout"
91+
"test_plot_projected"
92+
"test_plot_scaled"
93+
];
8194

82-
meta = with lib; {
95+
meta = {
8396
description = "Text analysis with networks";
8497
homepage = "https://textnets.readthedocs.io";
8598
changelog = "https://github.com/jboynyc/textnets/blob/v${version}/HISTORY.rst";
86-
license = licenses.gpl3Only;
87-
maintainers = with maintainers; [ jboy ];
99+
license = lib.licenses.gpl3Only;
100+
maintainers = with lib.maintainers; [ jboy ];
88101
};
89102
}

0 commit comments

Comments
 (0)