1{
2 lib,
3 buildPythonPackage,
4 cmake,
5 cvxopt,
6 fetchPypi,
7 future,
8 numpy,
9 oldest-supported-numpy,
10 pytestCheckHook,
11 pythonOlder,
12 qdldl,
13 scipy,
14 setuptools-scm,
15}:
16
17buildPythonPackage rec {
18 pname = "osqp";
19 version = "0.6.7";
20 pyproject = true;
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-O3ARmFV6SZxg67U9fyUBkGSFXHMvTz+84gVdeJ5Tph0=";
27 };
28
29 dontUseCmakeConfigure = true;
30
31 nativeBuildInputs = [
32 cmake
33 oldest-supported-numpy
34 setuptools-scm
35 ];
36
37 pythonRelaxDeps = [ "scipy" ];
38
39 propagatedBuildInputs = [
40 future
41 numpy
42 qdldl
43 scipy
44 ];
45
46 nativeCheckInputs = [
47 cvxopt
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [ "osqp" ];
52
53 disabledTests =
54 [
55 # Need an unfree license package - mkl
56 "test_issue14"
57 ]
58 # disable tests failing after scipy 1.12 update
59 # https://github.com/osqp/osqp-python/issues/121
60 # re-enable once unit tests fixed
61 ++ [
62 "feasibility_tests"
63 "polish_tests"
64 "update_matrices_tests"
65 ];
66
67 meta = with lib; {
68 description = "Operator Splitting QP Solver";
69 longDescription = ''
70 Numerical optimization package for solving problems in the form
71 minimize 0.5 x' P x + q' x
72 subject to l <= A x <= u
73
74 where x in R^n is the optimization variable
75 '';
76 homepage = "https://osqp.org/";
77 downloadPage = "https://github.com/oxfordcontrol/osqp-python/releases";
78 license = licenses.asl20;
79 maintainers = with maintainers; [ drewrisinger ];
80 };
81}