1{ lib
2, pythonOlder
3, buildPythonPackage
4, fetchFromGitHub
5, pkgs
6, numpy
7, scipy
8 # check inputs
9, nose
10}:
11
12buildPythonPackage rec {
13 pname = "ecos";
14 version = "2.0.8";
15
16 disabled = pythonOlder "3.6";
17
18 src = fetchFromGitHub {
19 owner = "embotech";
20 repo = "ecos-python";
21 rev = version;
22 sha256 = "sha256-2OJqbcOZceeD2fO5cu9fohuUVaA2LwQOQSWR4jRv3mk=";
23 fetchSubmodules = true;
24 };
25
26 prePatch = ''
27 echo '__version__ = "${version}"' >> ./src/ecos/version.py
28 '';
29
30 propagatedBuildInputs = [
31 numpy
32 scipy
33 ];
34
35 checkInputs = [ nose ];
36 checkPhase = ''
37 # Run tests
38 cd ./src
39 nosetests test_interface.py test_interface_bb.py
40 '';
41 pythonImportsCheck = [ "ecos" ];
42
43 meta = with lib; {
44 description = "Python package for ECOS: Embedded Cone Solver";
45 downloadPage = "https://github.com/embotech/ecos-python/releases";
46 homepage = pkgs.ecos.meta.homepage;
47 license = licenses.asl20;
48 maintainers = with maintainers; [ drewrisinger ];
49 };
50}