python3Packages.osqp: 0.6.7.post3 -> 1.0.4

Changed files
+100 -43
pkgs
development
+69 -43
pkgs/development/python-modules/osqp/default.nix
···
{
lib,
buildPythonPackage,
cmake,
-
cvxopt,
-
fetchPypi,
-
future,
numpy,
-
oldest-supported-numpy,
-
pytestCheckHook,
-
pythonOlder,
-
qdldl,
scipy,
-
setuptools-scm,
}:
buildPythonPackage rec {
pname = "osqp";
-
version = "0.6.7.post3";
pyproject = true;
-
disabled = pythonOlder "3.7";
-
-
src = fetchPypi {
-
inherit pname version;
-
hash = "sha256-sMXgpyHyHJckCXpP1QEIME0pZGjRJOFvNKxnBG9wIOE=";
};
-
postPatch = ''
-
substituteInPlace pyproject.toml \
-
--replace-fail "numpy >= 2.0.0" numpy
-
'';
-
-
dontUseCmakeConfigure = true;
-
nativeBuildInputs = [
cmake
-
numpy
-
oldest-supported-numpy
setuptools-scm
];
-
-
pythonRelaxDeps = [
-
"scipy"
-
];
-
propagatedBuildInputs = [
numpy
-
qdldl
scipy
];
nativeCheckInputs = [
cvxopt
pytestCheckHook
];
pythonImportsCheck = [ "osqp" ];
-
disabledTests = [
-
# Need an unfree license package - mkl
-
"test_issue14"
-
]
-
# disable tests failing after scipy 1.12 update
-
# https://github.com/osqp/osqp-python/issues/121
-
# re-enable once unit tests fixed
-
++ [
-
"feasibility_tests"
-
"polish_tests"
-
"update_matrices_tests"
];
-
meta = with lib; {
description = "Operator Splitting QP Solver";
longDescription = ''
Numerical optimization package for solving problems in the form
···
'';
homepage = "https://osqp.org/";
downloadPage = "https://github.com/oxfordcontrol/osqp-python/releases";
-
license = licenses.asl20;
-
maintainers = with maintainers; [ drewrisinger ];
};
}
···
{
lib,
buildPythonPackage,
+
fetchFromGitHub,
+
replaceVars,
+
applyPatches,
+
+
# build-system
cmake,
+
ninja,
+
scikit-build-core,
+
pybind11,
+
setuptools-scm,
+
+
# dependencies
+
jinja2,
+
joblib,
numpy,
scipy,
+
+
# tests
+
cvxopt,
+
pytestCheckHook,
+
torch,
}:
+
let
+
qdldl_src = fetchFromGitHub {
+
owner = "osqp";
+
repo = "qdldl";
+
tag = "v0.1.8";
+
hash = "sha256-qCeOs4UjZLuqlbiLgp6BMxvw4niduCPDOOqFt05zi2E=";
+
};
+
+
osqp_src = applyPatches {
+
src = fetchFromGitHub {
+
owner = "osqp";
+
repo = "osqp";
+
tag = "v1.0.0";
+
hash = "sha256-BOAytzJzHcggncQzeDrXwJOq8B3doWERJ6CKIVg1yJY=";
+
};
+
patches = [
+
(replaceVars ./dont-fetch-qdldl.patch {
+
inherit qdldl_src;
+
})
+
];
+
};
+
in
+
buildPythonPackage rec {
pname = "osqp";
+
version = "1.0.4";
pyproject = true;
+
src = fetchFromGitHub {
+
owner = "osqp";
+
repo = "osqp-python";
+
tag = "v${version}";
+
hash = "sha256-i39tphtGO//MS5sqwn6qx5ORR/A8moi0O8ltGGmkv2w=";
};
+
patches = [
+
(replaceVars ./dont-fetch-osqp.patch {
+
inherit osqp_src;
+
})
+
];
+
build-system = [
cmake
+
ninja
+
pybind11
+
scikit-build-core
setuptools-scm
];
+
dontUseCmakeConfigure = true;
+
dependencies = [
+
jinja2
+
joblib
numpy
scipy
];
nativeCheckInputs = [
cvxopt
pytestCheckHook
+
torch
];
pythonImportsCheck = [ "osqp" ];
+
disabledTestPaths = [
+
# CalledProcessError
+
# Try to invoke `python setup.py build_ext --inplace`
+
"src/osqp/tests/codegen_matrices_test.py"
+
"src/osqp/tests/codegen_vectors_test.py"
];
+
meta = {
description = "Operator Splitting QP Solver";
longDescription = ''
Numerical optimization package for solving problems in the form
···
'';
homepage = "https://osqp.org/";
downloadPage = "https://github.com/oxfordcontrol/osqp-python/releases";
+
license = lib.licenses.asl20;
+
maintainers = with lib.maintainers; [ drewrisinger ];
};
}
+14
pkgs/development/python-modules/osqp/dont-fetch-osqp.patch
···
···
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
+
index 3334931..64220c4 100644
+
--- a/CMakeLists.txt
+
+++ b/CMakeLists.txt
+
@@ -27,8 +27,7 @@ message(STATUS "Fetching/configuring OSQP")
+
list(APPEND CMAKE_MESSAGE_INDENT " ")
+
FetchContent_Declare(
+
osqp
+
- GIT_REPOSITORY https://github.com/osqp/osqp.git
+
- GIT_TAG v1.0.0
+
+ URL @osqp_src@
+
)
+
list(POP_BACK CMAKE_MESSAGE_INDENT)
+
FetchContent_MakeAvailable(osqp)
+14
pkgs/development/python-modules/osqp/dont-fetch-qdldl.patch
···
···
+
diff --git a/algebra/_common/lin_sys/qdldl/qdldl.cmake b/algebra/_common/lin_sys/qdldl/qdldl.cmake
+
index ac777bd0..3e419097 100644
+
--- a/algebra/_common/lin_sys/qdldl/qdldl.cmake
+
+++ b/algebra/_common/lin_sys/qdldl/qdldl.cmake
+
@@ -5,8 +5,7 @@ list(APPEND CMAKE_MESSAGE_INDENT " ")
+
+
FetchContent_Declare(
+
qdldl
+
- GIT_REPOSITORY https://github.com/osqp/qdldl.git
+
- GIT_TAG v0.1.8
+
+ URL @qdldl_src@
+
)
+
+
# Make QDLDL use the same types as OSQP
+3
pkgs/development/python-modules/scikit-survival/default.nix
···
setuptools-scm
];
dependencies = [
ecos
joblib
···
setuptools-scm
];
+
pythonRelaxDeps = [
+
"osqp"
+
];
dependencies = [
ecos
joblib