nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 python,
6 fetchPypi,
7}:
8
9let
10 format = "wheel";
11 pyShortVersion = "cp" + builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
12 platforms = rec {
13 aarch64-darwin =
14 if pyShortVersion == "cp314" then "macosx_10_15_universal2" else "macosx_10_13_universal2";
15 aarch64-linux = "manylinux_2_26_aarch64";
16 x86_64-darwin = aarch64-darwin;
17 x86_64-linux = "manylinux2014_x86_64.manylinux_2_17_x86_64";
18 };
19 platform = platforms.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
20 hashes = rec {
21 cp312-aarch64-darwin = "sha256-hQ9VN5Wl8RQ53ShE5q/LqzgNsZHX27W7b05rGeH95jc=";
22 cp312-aarch64-linux = "sha256-wKQjIAmhM+Smk3XzzlR8ZtwxJpr8hvbV15QTfSMxuE8=";
23 cp312-x86_64-darwin = cp312-aarch64-darwin;
24 cp312-x86_64-linux = "sha256-yISDKQFJYKZAxXE2vyrcanXcc3FvUHKcpshtaLnwtrI=";
25 cp313-aarch64-darwin = "sha256-j8E8zsPr1m4q7p1i4ihUuzPSczbRKuZGWp0C/oNx0Lc=";
26 cp313-aarch64-linux = "sha256-QvHfssbnKwoBmcqqBbOP2wLclJ7xol6054n8XqUtk44=";
27 cp313-x86_64-darwin = cp313-aarch64-darwin;
28 cp313-x86_64-linux = "sha256-wVm6yMfrL0rMgVebo/WGAyb7LKOp139g8U0GhgCbRoc=";
29 cp314-aarch64-darwin = "sha256-QCytKZtPSzdGDKg0LjFbJS/y5whqa8mcotNfecYXPVw=";
30 cp314-aarch64-linux = "sha256-qHAOVJwmZ6ojUDSmFJrxaiE4unwfns0VtVdUcEq2zq8=";
31 cp314-x86_64-darwin = cp314-aarch64-darwin;
32 cp314-x86_64-linux = "sha256-WUSCCjJ4uWTwxIsasIOizEmZ9HuZBoWVV0F3wPiXOCY=";
33 };
34 hash =
35 hashes."${pyShortVersion}-${stdenv.system}"
36 or (throw "Unsupported Python version: ${python.pythonVersion}");
37in
38buildPythonPackage rec {
39 pname = "gurobipy";
40 version = "13.0.1";
41 inherit format;
42
43 src = fetchPypi {
44 inherit pname version;
45 python = pyShortVersion;
46 abi = pyShortVersion;
47 dist = pyShortVersion;
48 inherit format platform hash;
49 };
50
51 pythonImportsCheck = [ "gurobipy" ];
52
53 meta = {
54 description = "Python interface to Gurobi";
55 homepage = "https://www.gurobi.com";
56 license = lib.licenses.unfree;
57 maintainers = with lib.maintainers; [ wegank ];
58 platforms = builtins.attrNames platforms;
59 };
60}