1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 niapy,
6 numpy,
7 pandas,
8 poetry-core,
9 pytestCheckHook,
10 pythonOlder,
11 scikit-learn,
12 toml-adapt,
13}:
14
15buildPythonPackage rec {
16 pname = "niaclass";
17 version = "0.2.4";
18 pyproject = true;
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "firefly-cpp";
24 repo = "NiaClass";
25 tag = version;
26 hash = "sha256-hJ3ZNl13s/woL4G08nNFqL+/olXUtg9MZQQr0BGX0ys=";
27 };
28
29 pythonRelaxDeps = [
30 "numpy"
31 "pandas"
32 ];
33
34 nativeBuildInputs = [
35 poetry-core
36 toml-adapt
37 ];
38
39 propagatedBuildInputs = [
40 niapy
41 numpy
42 pandas
43 scikit-learn
44 ];
45
46 # create scikit-learn dep version consistent
47 preBuild = ''
48 toml-adapt -path pyproject.toml -a change -dep scikit-learn -ver X
49 '';
50
51 nativeCheckInputs = [ pytestCheckHook ];
52
53 pythonImportsCheck = [ "niaclass" ];
54
55 meta = with lib; {
56 description = "Framework for solving classification tasks using Nature-inspired algorithms";
57 homepage = "https://github.com/firefly-cpp/NiaClass";
58 changelog = "https://github.com/firefly-cpp/NiaClass/releases/tag/${src.tag}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ firefly-cpp ];
61 };
62}