Merge pull request #244532 from renesat/submit/qpsolvers

python311Packages.qpsolvers: init at 3.4.0
This commit is contained in:
OTABI Tomoya 2023-09-05 09:49:11 +09:00 committed by GitHub
commit 63e0a0076c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 116 additions and 30 deletions

View file

@ -0,0 +1,52 @@
{ lib
, stdenv
, fetchFromGitHub
, buildPythonPackage
, unittestCheckHook
, cython
, setuptools
, wheel
, numpy
}:
buildPythonPackage {
pname = "daqp";
version = "0.5.1";
format = "pyproject";
src = fetchFromGitHub {
owner = "darnstrom";
repo = "daqp";
rev = "5a15a3d16731d3d50f867218c1b281567db556fd";
hash = "sha256-in7Ci/wM7i0csJ4XVfo1lboWOyfuuU+8E+TzGmMV3x0=";
};
sourceRoot = "source/interfaces/daqp-python";
postPatch = ''
sed -i 's|../../../daqp|../..|' setup.py
sed -i 's|if src_path and os.path.exists(src_path):|if False:|' setup.py
'';
nativeCheckInputs = [ unittestCheckHook ];
unittestFlagsArray = [ "-s" "test" "-p" "'*.py'" "-v" ];
nativeBuildInputs = [
cython
setuptools
wheel
];
propagatedBuildInputs = [
numpy
];
pythonImportsCheck = [ "daqp" ];
meta = with lib; {
description = "A dual active-set algorithm for convex quadratic programming";
homepage = "https://github.com/darnstrom/daqp";
license = licenses.mit;
maintainers = with maintainers; [ renesat ];
};
}

View file

@ -14,20 +14,16 @@
buildPythonPackage rec {
pname = "osqp";
version = "0.6.2.post8";
version = "0.6.3";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-I9a65KNhL2DV9lLQ5fpLLq1QfKv/9dkw2CIFeubtZnc=";
hash = "sha256-A+Rg5oPsLOD4OTU936PEyP+lCauM9qKyr7tYb6RT4YA=";
};
postPatch = ''
sed -i 's/sp.random/np.random/g' src/osqp/tests/*.py
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
dontUseCmakeConfigure = true;
@ -54,29 +50,8 @@ buildPythonPackage rec {
];
disabledTests = [
# 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"
# Need an unfree license package - mkl
"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"
];
meta = with lib; {

View file

@ -0,0 +1,48 @@
{ lib
, stdenv
, fetchFromGitHub
, buildPythonPackage
, unittestCheckHook
, daqp
, ecos
, numpy
, osqp
, scipy
, scs
, quadprog
}:
buildPythonPackage rec {
pname = "qpsolvers";
version = "3.4.0";
format = "flit";
src = fetchFromGitHub {
owner = "qpsolvers";
repo = "qpsolvers";
rev = "v${version}";
hash = "sha256-GrYAhTWABBvU6rGoHi00jBa7ryjCNgzO/hQBTdSW9cg=";
};
pythonImportsCheck = [ "qpsolvers" ];
propagatedBuildInputs = [
daqp
ecos
numpy
osqp
scipy
scs
];
nativeCheckInputs = [
quadprog
unittestCheckHook
];
meta = with lib; {
description = "Quadratic programming solvers in Python with a unified API";
homepage = "https://github.com/qpsolvers/qpsolvers";
license = licenses.lgpl3Plus;
maintainers = with maintainers; [ renesat ];
};
}

View file

@ -1,4 +1,5 @@
{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, blas
@ -11,13 +12,13 @@
buildPythonPackage rec {
pname = "scs";
version = "3.0.0";
version = "3.2.3";
src = fetchFromGitHub {
owner = "bodono";
repo = "scs-python";
rev = version;
hash = "sha256-7OgqCo21S0FDev8xv6/8iGFXg8naVi93zd8v1f9iaWw=";
hash = "sha256-/5yGvZy3luGQkbYcsb/6TZLYou91lpA3UKONviMVpuM=";
fetchSubmodules = true;
};
@ -33,6 +34,12 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "scs" ];
disabledTests = lib.lists.optional (stdenv.system == "x86_64-linux") [
# `test/test_scs_rand.py` hang on "x86_64-linux" (https://github.com/NixOS/nixpkgs/pull/244532#pullrequestreview-1598095858)
"test_feasible"
"test_infeasibl"
"test_unbounded"
];
meta = with lib; {
description = "Python interface for SCS: Splitting Conic Solver";

View file

@ -2433,6 +2433,8 @@ self: super: with self; {
daphne = callPackage ../development/python-modules/daphne { };
daqp = callPackage ../development/python-modules/daqp { };
dasbus = callPackage ../development/python-modules/dasbus { };
dash = callPackage ../development/python-modules/dash { };
@ -10886,6 +10888,8 @@ self: super: with self; {
qpageview = callPackage ../development/python-modules/qpageview { };
qpsolvers = callPackage ../development/python-modules/qpsolvers { };
qrcode = callPackage ../development/python-modules/qrcode { };
qreactor = callPackage ../development/python-modules/qreactor { };