1{
2 lib,
3 cbc,
4 amply,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pyparsing,
8 pythonOlder,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "pulp";
14 version = "2.8.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "coin-or";
21 repo = "pulp";
22 tag = version;
23 hash = "sha256-lpbk1GeC8F/iLGV8G5RPHghnaM9eL82YekUYEt9+mvc=";
24 };
25
26 postPatch = ''
27 sed -i pulp/pulp.cfg.linux \
28 -e 's|CbcPath = .*|CbcPath = ${cbc}/bin/cbc|' \
29 -e 's|PulpCbcPath = .*|PulpCbcPath = ${cbc}/bin/cbc|'
30 '';
31
32 propagatedBuildInputs = [
33 amply
34 pyparsing
35 ];
36
37 nativeCheckInputs = [ pytestCheckHook ];
38
39 pythonImportsCheck = [ "pulp" ];
40
41 meta = with lib; {
42 description = "Module to generate MPS or LP files";
43 mainProgram = "pulptest";
44 homepage = "https://github.com/coin-or/pulp";
45 license = licenses.mit;
46 maintainers = with maintainers; [ teto ];
47 };
48}