1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 poetry-core,
9
10 # dependencies
11 niapy,
12 nltk,
13 numpy,
14 pandas,
15 plotly,
16 scikit-learn,
17 pythonOlder,
18 tomli,
19
20 # tests
21 pytestCheckHook,
22}:
23
24buildPythonPackage rec {
25 pname = "niaarm";
26 # nixpkgs-update: no auto update
27 version = "0.13.4";
28 pyproject = true;
29
30 src = fetchFromGitHub {
31 owner = "firefly-cpp";
32 repo = "NiaARM";
33 tag = version;
34 hash = "sha256-524rJ5b9e0U1rqu1iCGMA3Tgnn9bO4biCC1FMoGNqms=";
35 };
36
37 pythonRelaxDeps = [
38 "numpy"
39 "plotly"
40 "scikit-learn"
41 ];
42
43 build-system = [ poetry-core ];
44
45 dependencies = [
46 niapy
47 nltk
48 numpy
49 pandas
50 plotly
51 scikit-learn
52 ]
53 ++ lib.optionals (pythonOlder "3.11") [ tomli ];
54
55 disabledTests = [
56 # Test requires extra nltk data dependency
57 "test_text_mining"
58 ]
59 ++ lib.optionals stdenv.hostPlatform.isDarwin [
60 # Fatal Python error: Aborted
61 # matplotlib/backend_bases.py", line 2654 in create_with_canvas
62 "test_hill_slopes"
63 "test_two_key_plot"
64 ];
65
66 nativeCheckInputs = [ pytestCheckHook ];
67
68 pythonImportsCheck = [ "niaarm" ];
69
70 meta = {
71 description = "Minimalistic framework for Numerical Association Rule Mining";
72 mainProgram = "niaarm";
73 homepage = "https://github.com/firefly-cpp/NiaARM";
74 changelog = "https://github.com/firefly-cpp/NiaARM/releases/tag/${src.tag}";
75 license = lib.licenses.mit;
76 maintainers = with lib.maintainers; [ firefly-cpp ];
77 };
78}