2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, cmake
|
2022-10-30 15:09:59 +00:00
|
|
|
, cvxopt
|
|
|
|
, fetchPypi
|
2020-04-24 23:36:52 +00:00
|
|
|
, future
|
|
|
|
, numpy
|
2022-10-30 15:09:59 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2021-01-15 22:18:51 +00:00
|
|
|
, qdldl
|
2020-04-24 23:36:52 +00:00
|
|
|
, scipy
|
2022-10-30 15:09:59 +00:00
|
|
|
, setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "osqp";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.6.2.post8";
|
2022-10-30 15:09:59 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-I9a65KNhL2DV9lLQ5fpLLq1QfKv/9dkw2CIFeubtZnc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/sp.random/np.random/g' src/osqp/tests/*.py
|
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
future
|
|
|
|
numpy
|
2021-01-15 22:18:51 +00:00
|
|
|
qdldl
|
2020-04-24 23:36:52 +00:00
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-10-30 15:09:59 +00:00
|
|
|
cvxopt
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"osqp"
|
|
|
|
];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
disabledTests = [
|
2022-10-30 15:09:59 +00:00
|
|
|
# Test are failing due to scipy update (removal of scipy.random in 1.9.0)
|
|
|
|
# Is fixed upstream but requires a new release
|
|
|
|
"test_feasibility_problem"
|
|
|
|
"test_issue14"
|
|
|
|
"test_polish_random"
|
|
|
|
"test_polish_unconstrained"
|
|
|
|
"test_primal_and_dual_infeasible_problem"
|
|
|
|
"test_primal_infeasible_problem"
|
|
|
|
"test_solve"
|
|
|
|
"test_unconstrained_problem"
|
|
|
|
"test_update_A_allind"
|
|
|
|
"test_update_A"
|
|
|
|
"test_update_bounds"
|
|
|
|
"test_update_l"
|
|
|
|
"test_update_P_A_allind"
|
|
|
|
"test_update_P_A_indA"
|
|
|
|
"test_update_P_A_indP_indA"
|
|
|
|
"test_update_P_A_indP"
|
|
|
|
"test_update_P_allind"
|
|
|
|
"test_update_P"
|
|
|
|
"test_update_q"
|
|
|
|
"test_update_u"
|
|
|
|
"test_warm_start"
|
2020-08-20 17:08:02 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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-python/releases";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|