Skip to content
Closed

Cvxpy #59518

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions pkgs/development/python-modules/cvxpy/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{ buildPythonPackage
, fetchPypi
, osqp
, ecos
, scs
, multiprocess
, fastcache
, six
, numpy
, scipy
, nose
, lib
}:

buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

pname = "cvxpy";
version = "1.0.21";

propagatedBuildInputs = [
osqp ecos scs multiprocess fastcache six numpy scipy
];

checkInputs = [ nose ];

src = fetchPypi {
inherit pname version;
sha256 = "11hdrgdcb7idncrbr00rmrxhi7f8sjm134x4wgqkkxwppklk36xv";
};

# Tests not discovered correctly on python3 unless nosetests invoked
# explicitly.
checkPhase = "nosetests -v";

meta = {
description = "A Python-embedded modeling language for convex optimization problems";
homepage = https://www.cvxpy.org;
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.teh ];
};
}
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/ecos/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ buildPythonPackage, fetchPypi, lib, numpy, scipy, nose }:

buildPythonPackage rec {
pname = "ecos";
version = "2.0.7.post1";

propagatedBuildInputs = [
numpy
scipy
];
checkInputs = [ nose ];

src = fetchPypi {
inherit pname version;
sha256 = "0n67plhclbsxqi23is8rj62vv3d75nnwzhsmya9jlbpknd10zsc3";
};

meta = {
description = "This is the Python package for ECOS: Embedded Cone Solver";
homepage = https://github.com/embotech/ecos;
license = lib.licenses.gpl3;
maintainers = [ lib.maintainers.teh ];
};
}
26 changes: 26 additions & 0 deletions pkgs/development/python-modules/osqp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ buildPythonPackage, fetchFromGitHub, lib, numpy, scipy, future, cmake }:

buildPythonPackage rec {
pname = "osqp-python";
version = "2.0a1";

nativeBuildInputs = [ cmake ];
dontUseCmakeConfigure = true;

propagatedBuildInputs = [ numpy future scipy ];

src = fetchFromGitHub {
owner = "oxfordcontrol";
repo = "osqp-python";
rev = "v0.5.0";
fetchSubmodules = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this? Can we not package that one separately?

Copy link
Contributor Author

@teh teh Apr 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could download the source separately but AFAICT the python module needs the osqp source, i.e. it's not just linking against a library [1].

[1]
https://github.com/oxfordcontrol/osqp-python/blob/master/setup.py#L95

sha256 = "1x65mmm9sq189ncgm1fha245krk2y7aq0gw3g1fld0z36zrs9ynz";
};

meta = {
description = "Python interface for OSQP";
homepage = https://osqp.org;
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.teh ];
};
}
23 changes: 23 additions & 0 deletions pkgs/development/python-modules/scs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ buildPythonPackage, fetchPypi, lib, numpy, scipy }:

buildPythonPackage rec {
pname = "scs";
version = "2.1.0";

propagatedBuildInputs = [
numpy
scipy
];

src = fetchPypi {
inherit pname version;
sha256 = "1m45366lfkv71mhdmr10ch7wgn16n79rg75jxqizqcgg6r5s6rqx";
};

meta = {
description = "scs: splitting conic solver";
homepage = https://github.com/cvxgrp/scs;
license = lib.licenses.mit;
maintainers = [ lib.maintainers.teh ];
};
}
8 changes: 8 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ in {

curio = callPackage ../development/python-modules/curio { };

cvxpy = callPackage ../development/python-modules/cvxpy { };

dendropy = callPackage ../development/python-modules/dendropy { };

dependency-injector = callPackage ../development/python-modules/dependency-injector { };
Expand Down Expand Up @@ -535,6 +537,8 @@ in {

ewmh = callPackage ../development/python-modules/ewmh { };

ecos = callPackage ../development/python-modules/ecos { };

exchangelib = callPackage ../development/python-modules/exchangelib { };

dbus-python = callPackage ../development/python-modules/dbus {
Expand Down Expand Up @@ -803,6 +807,8 @@ in {

osmnx = callPackage ../development/python-modules/osmnx { };

osqp = callPackage ../development/python-modules/osqp { };

outcome = callPackage ../development/python-modules/outcome {};

ovito = toPythonModule (pkgs.libsForQt5.callPackage ../development/python-modules/ovito {
Expand Down Expand Up @@ -1214,6 +1220,8 @@ in {

sslib = callPackage ../development/python-modules/sslib { };

scs = callPackage ../development/python-modules/scs { };

statistics = callPackage ../development/python-modules/statistics { };

stm32loader = callPackage ../development/python-modules/stm32loader { };
Expand Down