Skip to content
Merged
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
51 changes: 51 additions & 0 deletions pkgs/development/python-modules/osqp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ lib
, buildPythonPackage
, fetchPypi
, cmake
, future
, numpy
# check inputs
, scipy
, pytestCheckHook
, mkl
}:

buildPythonPackage rec {
pname = "osqp";
version = "0.6.1";

src = fetchPypi {
inherit pname version;
sha256 = "130frig5bznfacqp9jwbshmbqd2xw3ixdspsbkrwsvkdaab7kca7";
};

nativeBuildInputs = [ cmake ];
dontUseCmakeConfigure = true;

propagatedBuildInputs = [
numpy
future
];

checkInputs = [ scipy pytestCheckHook mkl ];
pythonImportsCheck = [ "osqp" ];
dontUseSetuptoolsCheck = true; # running setup.py fails if false
preCheck = ''
export LD_LIBRARY_PATH=${lib.strings.makeLibraryPath [ mkl ]}:$LD_LIBRARY_PATH;
'';

meta = with lib; {
description = "The Operator Splitting QP Solver";
longDescription = ''
Numerical optimization package for solving problems in the form
minimize 0.5 x' P x + q' x
subject to l <= A x <= u

where x in R^n is the optimization variable
'';
homepage = "https://osqp.org/";
downloadPage = "https://github.com/oxfordcontrol/osqp";
license = licenses.asl20;
maintainers = with lib.maintainers; [ drewrisinger ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2985,6 +2985,8 @@ in {

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

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

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

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