about summary refs log tree commit diff
path: root/pkgs/development/python-modules/mip/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/mip/default.nix')
-rw-r--r--pkgs/development/python-modules/mip/default.nix64
1 files changed, 35 insertions, 29 deletions
diff --git a/pkgs/development/python-modules/mip/default.nix b/pkgs/development/python-modules/mip/default.nix
index 5705f1f37cfd..a2c6e80e3f16 100644
--- a/pkgs/development/python-modules/mip/default.nix
+++ b/pkgs/development/python-modules/mip/default.nix
@@ -1,23 +1,25 @@
-{ lib, stdenv
-, buildPythonPackage
-, cffi
-, dos2unix
-, fetchPypi
-, matplotlib
-, networkx
-, numpy
-, pytestCheckHook
-, pythonOlder
-, setuptools
-, setuptools-scm
-, wheel
-, gurobi
-, gurobipy
-# Enable support for the commercial Gurobi solver (requires a license)
-, gurobiSupport ? false
-# If Gurobi has already been installed outside of the Nix store, specify its
-# installation directory here
-, gurobiHome ? null
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  cffi,
+  dos2unix,
+  fetchPypi,
+  matplotlib,
+  networkx,
+  numpy,
+  pytestCheckHook,
+  pythonOlder,
+  setuptools,
+  setuptools-scm,
+  wheel,
+  gurobi,
+  gurobipy,
+  # Enable support for the commercial Gurobi solver (requires a license)
+  gurobiSupport ? false,
+  # If Gurobi has already been installed outside of the Nix store, specify its
+  # installation directory here
+  gurobiHome ? null,
 }:
 
 buildPythonPackage rec {
@@ -32,7 +34,12 @@ buildPythonPackage rec {
     hash = "sha256-f28Dgc/ixSwbhkAgPaLLVpdLJuI5UN37GnazfZFvGX4=";
   };
 
-  nativeCheckInputs = [ matplotlib networkx numpy pytestCheckHook ];
+  nativeCheckInputs = [
+    matplotlib
+    networkx
+    numpy
+    pytestCheckHook
+  ];
 
   nativeBuildInputs = [
     dos2unix
@@ -43,9 +50,7 @@ buildPythonPackage rec {
 
   propagatedBuildInputs = [
     cffi
-  ] ++ lib.optionals gurobiSupport ([
-    gurobipy
-  ] ++ lib.optional (gurobiHome == null) gurobi);
+  ] ++ lib.optionals gurobiSupport ([ gurobipy ] ++ lib.optional (gurobiHome == null) gurobi);
 
   # Source files have CRLF terminators, which make patch error out when supplied
   # with diffs made on *nix machines
@@ -67,23 +72,24 @@ buildPythonPackage rec {
   '';
 
   # Make MIP use the Gurobi solver, if configured to do so
-  makeWrapperArgs = lib.optional gurobiSupport
-    "--set GUROBI_HOME ${if gurobiHome == null then gurobi.outPath else gurobiHome}";
+  makeWrapperArgs = lib.optional gurobiSupport "--set GUROBI_HOME ${
+    if gurobiHome == null then gurobi.outPath else gurobiHome
+  }";
 
   # Tests that rely on Gurobi are activated only when Gurobi support is enabled
   disabledTests = lib.optional (!gurobiSupport) "gurobi";
 
-  passthru.optional-dependencies = {
+  optional-dependencies = {
     inherit gurobipy numpy;
   };
 
   meta = with lib; {
     homepage = "https://python-mip.com/";
-    description = "A collection of Python tools for the modeling and solution of Mixed-Integer Linear programs (MIPs)";
+    description = "Collection of Python tools for the modeling and solution of Mixed-Integer Linear programs (MIPs)";
     downloadPage = "https://github.com/coin-or/python-mip/releases";
     changelog = "https://github.com/coin-or/python-mip/releases/tag/${version}";
     license = licenses.epl20;
-    broken = stdenv.isAarch64;
+    broken = stdenv.hostPlatform.isAarch64;
     maintainers = with maintainers; [ nessdoor ];
   };
 }