1{
2 lib,
3 buildPythonPackage,
4 cairocffi,
5 cython,
6 fetchPypi,
7 igraph,
8 leidenalg,
9 pandas,
10 poetry-core,
11 pytestCheckHook,
12 pythonOlder,
13 pythonRelaxDepsHook,
14 scipy,
15 setuptools,
16 spacy,
17 spacy-lookups-data,
18 en_core_web_sm,
19 toolz,
20 tqdm,
21 wasabi,
22}:
23
24buildPythonPackage rec {
25 pname = "textnets";
26 version = "0.9.4";
27 format = "pyproject";
28
29 disabled = pythonOlder "3.8";
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-4154ytzo1QpwhKA1BkVMss9fNIkysnClW/yfSVlX33M=";
34 };
35
36 nativeBuildInputs = [
37 pythonRelaxDepsHook
38 cython
39 poetry-core
40 setuptools
41 ];
42
43 pythonRelaxDeps = [
44 "igraph"
45 "leidenalg"
46 ];
47
48 propagatedBuildInputs = [
49 cairocffi
50 igraph
51 leidenalg
52 pandas
53 scipy
54 spacy
55 spacy-lookups-data
56 toolz
57 tqdm
58 wasabi
59 ];
60
61 nativeCheckInputs = [
62 pytestCheckHook
63 en_core_web_sm
64 ];
65
66 pythonImportsCheck = [ "textnets" ];
67
68 # Enables the package to find the cythonized .so files during testing. See #255262
69 preCheck = ''
70 rm -r textnets
71 '';
72
73 disabledTests = [
74 # Test fails: Throws a UserWarning asking the user to install `textnets[fca]`.
75 "test_context"
76 ];
77
78 meta = with lib; {
79 description = "Text analysis with networks";
80 homepage = "https://textnets.readthedocs.io";
81 changelog = "https://github.com/jboynyc/textnets/blob/v${version}/HISTORY.rst";
82 license = licenses.gpl3Only;
83 maintainers = with maintainers; [ jboy ];
84 };
85}