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.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "firefly-cpp";
24 repo = "NiaClass";
25 rev = "refs/tags/${version}";
26 hash = "sha256-C3EF18lzheE+dXHJA6WJNFECAH4HfPiCDo7QxtHvOLI=";
27 };
28
29 pythonRelaxDeps = [ "pandas" ];
30
31 nativeBuildInputs = [
32 poetry-core
33 toml-adapt
34 ];
35
36 propagatedBuildInputs = [
37 niapy
38 numpy
39 pandas
40 scikit-learn
41 ];
42
43 # create scikit-learn dep version consistent
44 preBuild = ''
45 toml-adapt -path pyproject.toml -a change -dep scikit-learn -ver X
46 '';
47
48 nativeCheckInputs = [ pytestCheckHook ];
49
50 pythonImportsCheck = [ "niaclass" ];
51
52 meta = with lib; {
53 description = "Framework for solving classification tasks using Nature-inspired algorithms";
54 homepage = "https://github.com/firefly-cpp/NiaClass";
55 changelog = "https://github.com/firefly-cpp/NiaClass/releases/tag/${version}";
56 license = licenses.mit;
57 maintainers = with maintainers; [ firefly-cpp ];
58 };
59}