Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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.post3"; 20 pyproject = true; 21 22 disabled = pythonOlder "3.7"; 23 24 src = fetchPypi { 25 inherit pname version; 26 hash = "sha256-sMXgpyHyHJckCXpP1QEIME0pZGjRJOFvNKxnBG9wIOE="; 27 }; 28 29 postPatch = '' 30 substituteInPlace pyproject.toml \ 31 --replace-fail "numpy >= 2.0.0" numpy 32 ''; 33 34 dontUseCmakeConfigure = true; 35 36 nativeBuildInputs = [ 37 cmake 38 numpy 39 oldest-supported-numpy 40 setuptools-scm 41 ]; 42 43 pythonRelaxDeps = [ 44 "scipy" 45 ]; 46 47 propagatedBuildInputs = [ 48 numpy 49 qdldl 50 scipy 51 ]; 52 53 nativeCheckInputs = [ 54 cvxopt 55 pytestCheckHook 56 ]; 57 58 pythonImportsCheck = [ "osqp" ]; 59 60 disabledTests = [ 61 # Need an unfree license package - mkl 62 "test_issue14" 63 ] 64 # disable tests failing after scipy 1.12 update 65 # https://github.com/osqp/osqp-python/issues/121 66 # re-enable once unit tests fixed 67 ++ [ 68 "feasibility_tests" 69 "polish_tests" 70 "update_matrices_tests" 71 ]; 72 73 meta = with lib; { 74 description = "Operator Splitting QP Solver"; 75 longDescription = '' 76 Numerical optimization package for solving problems in the form 77 minimize 0.5 x' P x + q' x 78 subject to l <= A x <= u 79 80 where x in R^n is the optimization variable 81 ''; 82 homepage = "https://osqp.org/"; 83 downloadPage = "https://github.com/oxfordcontrol/osqp-python/releases"; 84 license = licenses.asl20; 85 maintainers = with maintainers; [ drewrisinger ]; 86 }; 87}