From 38c37f473d2d0842d6bf37ff781c6d983917da95 Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Mon, 27 Jan 2020 14:33:31 -0500 Subject: [PATCH] pythonPackages.osqp: init at 0.6.1 Oxford Splitting QP solver. Dependency for cvxpy -> qiskit-aer. --- .../python-modules/osqp/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/osqp/default.nix diff --git a/pkgs/development/python-modules/osqp/default.nix b/pkgs/development/python-modules/osqp/default.nix new file mode 100644 index 000000000000..237ad7a7a00a --- /dev/null +++ b/pkgs/development/python-modules/osqp/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 63cde6669fe8..8ee05ad69e69 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 { };