1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 numpy, 6 poetry-core, 7 pytestCheckHook, 8 pythonOlder, 9}: 10 11buildPythonPackage rec { 12 pname = "fireflyalgorithm"; 13 version = "0.4.6"; 14 pyproject = true; 15 16 disabled = pythonOlder "3.9"; 17 18 src = fetchFromGitHub { 19 owner = "firefly-cpp"; 20 repo = "FireflyAlgorithm"; 21 tag = version; 22 hash = "sha256-NMmwjKtIk8KR0YXXSXkJhiQsbjMusaLnstUWx0izCNA="; 23 }; 24 25 postPatch = '' 26 substituteInPlace pyproject.toml \ 27 --replace-fail 'numpy = "^1.26.1"' "" 28 ''; 29 30 build-system = [ poetry-core ]; 31 32 dependencies = [ numpy ]; 33 34 nativeCheckInputs = [ pytestCheckHook ]; 35 36 pythonImportsCheck = [ "fireflyalgorithm" ]; 37 38 meta = { 39 description = "Implementation of the stochastic nature-inspired algorithm for optimization"; 40 mainProgram = "firefly-algorithm"; 41 homepage = "https://github.com/firefly-cpp/FireflyAlgorithm"; 42 changelog = "https://github.com/firefly-cpp/FireflyAlgorithm/blob/${version}/CHANGELOG.md"; 43 license = lib.licenses.mit; 44 maintainers = with lib.maintainers; [ firefly-cpp ]; 45 }; 46}