Commit 9e326e07 authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files
parent 9aeb626f
Loading
Loading
Loading
Loading
+26 −12
Original line number Diff line number Diff line
@@ -2,19 +2,22 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,

  # dependencies
  numpy,

  # tests
  python,
  pythonOlder,
  setuptools,
}:

buildPythonPackage rec {
  pname = "cma";
  version = "4.3.0";
  version = "4.4.0";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "CMA-ES";
    repo = "pycma";
@@ -22,22 +25,33 @@ buildPythonPackage rec {
    hash = "sha256-2uCn5CZma9RLK8zaaPhiQCqnK+2dWgLNr5+Ck2cV6vI=";
  };

  # setuptools.errors.PackageDiscoveryError:
  # Multiple top-level packages discovered in a flat-layout: ['cma', 'notebooks'].
  postPatch = ''
    rm -rf notebooks
  '';

  build-system = [ setuptools ];

  dependencies = [ numpy ];

  checkPhase = ''
  pythonImportsCheck = [ "cma" ];

  # At least one doctest fails, thus only limited amount of files is tested
    ${python.executable} -m cma.test interfaces.py purecma.py logger.py optimization_tools.py transformations.py
  checkPhase = ''
    ${python.executable} -m cma.test \
      interfaces.py \
      purecma.py \
      logger.py \
      optimization_tools.py \
      transformations.py
  '';

  pythonImportsCheck = [ "cma" ];

  meta = with lib; {
  meta = {
    description = "Library for Covariance Matrix Adaptation Evolution Strategy for non-linear numerical optimization";
    homepage = "https://github.com/CMA-ES/pycma";
    changelog = "https://github.com/CMA-ES/pycma/releases/tag/r${src.tag}";
    license = licenses.bsd3;
    changelog = "https://github.com/CMA-ES/pycma/releases/tag/${src.tag}";
    license = lib.licenses.bsd3;
    maintainers = [ ];
  };
}