nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 niapy,
6 numpy,
7 poetry-core,
8 pytestCheckHook,
9 scikit-learn,
10 toml-adapt,
11 tomli,
12 torch,
13}:
14
15buildPythonPackage rec {
16 pname = "nianet";
17 version = "1.1.4";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "SasoPavlic";
22 repo = "nianet";
23 tag = "version_${version}";
24 sha256 = "sha256-FZipl6Z9AfiL6WH0kvUn8bVxt8JLdDVlmTSqnyxe0nY=";
25 };
26
27 build-system = [
28 poetry-core
29 toml-adapt
30 ];
31
32 dependencies = [
33 niapy
34 numpy
35 scikit-learn
36 torch
37 ];
38
39 pythonRelaxDeps = [
40 "numpy"
41 ];
42
43 # create niapy and torch dep version consistent
44 preBuild = ''
45 toml-adapt -path pyproject.toml -a change -dep niapy -ver X
46 toml-adapt -path pyproject.toml -a change -dep torch -ver X
47 '';
48
49 nativeCheckInputs = [
50 pytestCheckHook
51 tomli
52 ];
53
54 pythonImportsCheck = [ "nianet" ];
55
56 meta = {
57 description = "Designing and constructing neural network topologies using nature-inspired algorithms";
58 homepage = "https://github.com/SasoPavlic/NiaNet";
59 changelog = "https://github.com/SasoPavlic/NiaNet/releases/tag/v${version}";
60 license = lib.licenses.mit;
61 maintainers = with lib.maintainers; [ firefly-cpp ];
62 };
63}