nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
56 # Prevents 'Fatal Python error: Aborted' on darwin during checkPhase
57 MPLBACKEND = "Agg";
58 };
59
60 disabledTests = [
61 # Test requires extra nltk data dependency
62 "test_text_mining"
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/releases/tag/${src.tag}";
74 license = lib.licenses.mit;
75 maintainers = with lib.maintainers; [ firefly-cpp ];
76 };
77}