nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 cython,
9 pdm-backend,
10 setuptools,
11
12 # dependencies
13 igraph,
14 leidenalg,
15 matplotlib,
16 pandas,
17 pyarrow,
18 scipy,
19 spacy,
20 spacy-lookups-data,
21 toolz,
22 tqdm,
23 wasabi,
24
25 # tests
26 en_core_web_sm,
27 pytestCheckHook,
28}:
29
30buildPythonPackage rec {
31 pname = "textnets";
32 version = "0.10.4";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "jboynyc";
37 repo = "textnets";
38 tag = "v${version}";
39 hash = "sha256-GbJH+6EqfP+miqpYitnBwNDO6uQQq3h9Fy58nVaF1vw=";
40 };
41
42 build-system = [
43 cython
44 pdm-backend
45 setuptools
46 ];
47
48 pythonRelaxDeps = [
49 "toolz"
50 ];
51
52 dependencies = [
53 igraph
54 leidenalg
55 matplotlib
56 pandas
57 pyarrow
58 scipy
59 spacy
60 spacy-lookups-data
61 toolz
62 tqdm
63 wasabi
64 ];
65
66 nativeCheckInputs = [
67 en_core_web_sm
68 pytestCheckHook
69 ];
70
71 disabledTests = [
72 # https://github.com/jboynyc/textnets/issues/66
73 "test_textnet_save_and_load"
74 ];
75
76 pythonImportsCheck = [ "textnets" ];
77
78 # Enable the package to find the cythonized .so files during testing. See #255262
79 # Set MPLBACKEND=agg for headless matplotlib on darwin. See #350784
80 preCheck = ''
81 rm -r textnets
82 export MPLBACKEND=agg
83 '';
84
85 meta = {
86 description = "Text analysis with networks";
87 homepage = "https://textnets.readthedocs.io";
88 changelog = "https://github.com/jboynyc/textnets/blob/v${version}/HISTORY.rst";
89 license = lib.licenses.gpl3Only;
90 maintainers = with lib.maintainers; [ jboy ];
91 };
92}