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.4.1";
28 pyproject = true;
29
30 src = fetchFromGitHub {
31 owner = "firefly-cpp";
32 repo = "NiaARM";
33 tag = version;
34 hash = "sha256-/lEW6SUV+CRovYmLVWiolYDHYmMJSJHnYNo9+lBc9nY=";
35 };
36
37 pythonRelaxDeps = [
38 "numpy"
39 "scikit-learn"
40 ];
41
42 build-system = [ poetry-core ];
43
44 dependencies = [
45 niapy
46 nltk
47 numpy
48 pandas
49 plotly
50 scikit-learn
51 ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
52
53 disabledTests =
54 [
55 # Test requires extra nltk data dependency
56 "test_text_mining"
57 ]
58 ++ lib.optionals stdenv.hostPlatform.isDarwin [
59 # Fatal Python error: Aborted
60 # matplotlib/backend_bases.py", line 2654 in create_with_canvas
61 "test_hill_slopes"
62 "test_two_key_plot"
63 ];
64
65 nativeCheckInputs = [ pytestCheckHook ];
66
67 pythonImportsCheck = [ "niaarm" ];
68
69 meta = {
70 description = "Minimalistic framework for Numerical Association Rule Mining";
71 mainProgram = "niaarm";
72 homepage = "https://github.com/firefly-cpp/NiaARM";
73 changelog = "https://github.com/firefly-cpp/NiaARM/blob/${version}/CHANGELOG.md";
74 license = lib.licenses.mit;
75 maintainers = with lib.maintainers; [ firefly-cpp ];
76 };
77}