Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: test on windows #5

Merged
merged 18 commits into from
Mar 10, 2023
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
platform: [ubuntu-latest, macos-latest]
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
with:
Expand Down
18 changes: 15 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
import os

from ctypes import util

from Cython.Build import cythonize
from setuptools import setup
from setuptools.extension import Extension

libraries = ["scip"]
libraries = ["libscip"] if os.name == "nt" else ["scip"]
include_dirs = ['ilpy/impl']
library_dirs = []
compile_args = ["-O3", "-std=c++11", "-DHAVE_SCIP"]

# include conda environment windows include/lib if it exists
# this will be done automatically by conda build, but is useful if someone
# tries to build this directly with pip install in a conda environment
if os.name == "nt" and "CONDA_PREFIX" in os.environ:
include_dirs.append(os.path.join(os.environ["CONDA_PREFIX"], "Library", "include"))
library_dirs.append(os.path.join(os.environ["CONDA_PREFIX"], "Library", "lib"))

# look for various gurobi versions, which are annoyingly
# suffixed with the version number, and wildcards don't work
for v in ["100"]:
GUROBI_LIB = f"gurobi{v}"
GUROBI_LIB = f"libgurobi{v}" if os.name == 'nt' else f"gurobi{v}"
if (gurolib := util.find_library(GUROBI_LIB)) is not None:
print("FOUND GUROBI library: ", gurolib)
libraries.append(GUROBI_LIB)
Expand Down Expand Up @@ -38,8 +49,9 @@
'ilpy/wrapper.pyx',
],
extra_compile_args=compile_args,
include_dirs=['ilpy/impl'],
include_dirs=include_dirs,
libraries=libraries,
library_dirs=library_dirs,
language='c++')
]),
extras_require={
Expand Down