Skip to content

Commit a0af398

Browse files
committed
more debug
1 parent cbe6a25 commit a0af398

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

setup.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import glob
12
import os
23
from ctypes import util
34
from itertools import product
@@ -6,6 +7,41 @@
67
from setuptools import setup
78
from setuptools.extension import Extension
89

10+
print("PATH:", os.environ["PATH"])
11+
print("CONDA_PREFIX:", os.environ.get("CONDA_PREFIX"))
12+
13+
14+
def assert_gurobi_and_scip() -> None:
15+
# Get the Conda environment prefix
16+
conda_prefix = os.environ.get("CONDA_PREFIX")
17+
if not conda_prefix:
18+
raise RuntimeError("CONDA_PREFIX is not set. Ensure Conda is active in CI.")
19+
20+
# Paths to check
21+
gurobi_dll_path = os.path.join(conda_prefix, "Library", "bin", "gurobi*.dll")
22+
scip_header_path = os.path.join(
23+
conda_prefix, "Library", "include", "scip", "scipdefplugins.h"
24+
)
25+
26+
# Verify Gurobi DLL
27+
gurobi_found = any(os.path.exists(path) for path in glob.glob(gurobi_dll_path))
28+
if not gurobi_found:
29+
raise FileNotFoundError(
30+
f"Gurobi DLL not found in {gurobi_dll_path}. Ensure Gurobi is installed."
31+
)
32+
33+
# Verify SCIP header
34+
if not os.path.exists(scip_header_path):
35+
raise FileNotFoundError(
36+
f"SCIP header 'scipdefplugins.h' not found in {scip_header_path}. "
37+
"Ensure SCIP is installed."
38+
)
39+
40+
print("All required files are present.")
41+
42+
if os.name == "nt":
43+
assert_gurobi_and_scip()
44+
945
# enable test coverage tracing if CYTHON_TRACE is set to a non-zero value
1046
CYTHON_TRACE = int(os.getenv("CYTHON_TRACE") in ("1", "True"))
1147
if not (CONDA_PREFIX := os.environ.get("CONDA_PREFIX")):

0 commit comments

Comments
 (0)