1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, nose
6, numpy
7, pythonOlder
8, scipy
9}:
10
11buildPythonPackage rec {
12 pname = "ecos";
13 version = "2.0.10";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.6";
17
18 src = fetchFromGitHub {
19 owner = "embotech";
20 repo = "ecos-python";
21 rev = "v${version}";
22 sha256 = "sha256-TPxrTyVZ1KXgPoDbZZqXT5+NEIEndg9qepujqFQwK+Q=";
23 fetchSubmodules = true;
24 };
25
26 patches = [
27 # Fix for test_interface_bb.py tests
28 (fetchpatch {
29 name = "test_interface_bb_use_nparray.patch";
30 url = "https://github.com/embotech/ecos-python/commit/4440dcb7ddbd92217bc83d8916b72b61537dffbf.patch";
31 hash = "sha256-pcTPviK916jzCLllRhopbC9wDHv+aS6GmV/92sUwzHc=";
32 })
33 ];
34
35 propagatedBuildInputs = [
36 numpy
37 scipy
38 ];
39
40 checkInputs = [
41 nose
42 ];
43
44 checkPhase = ''
45 cd ./src
46 nosetests test_interface.py test_interface_bb.py
47 '';
48
49 pythonImportsCheck = [
50 "ecos"
51 ];
52
53 meta = with lib; {
54 description = "Python package for ECOS: Embedded Cone Solver";
55 homepage = "https://github.com/embotech/ecos-python";
56 license = licenses.gpl3Only;
57 maintainers = with maintainers; [ drewrisinger ];
58 };
59}