Skip to content
Commits on Source (2)
......@@ -14,7 +14,6 @@ variables:
.build: &build
stage: build
script:
- for FILE in patches/*.diff; do patch -p1 < $FILE; done
# Compile python module
- $PYTHON_ENV/bin/python setup.py build_ext --swig="${SWIG:-swig-4.0.0/swig}"
# Build package
......
environment:
CBC_VERSION: 2.10.3
matrix:
- PYTHON: "C:\\Python27"
CBC_FILE: Cbc-%CBC_VERSION%-win32-msvc9.zip
- PYTHON: "C:\\Python35"
CBC_FILE: Cbc-%CBC_VERSION%-win32-msvc14.zip
- PYTHON: "C:\\Python36"
CBC_FILE: Cbc-%CBC_VERSION%-win32-msvc14.zip
- PYTHON: "C:\\Python37"
CBC_FILE: Cbc-%CBC_VERSION%-win32-msvc15.zip
- PYTHON: "C:\\Python35-x64"
CBC_FILE: Cbc-%CBC_VERSION%-win32-msvc14.zip
- PYTHON: "C:\\Python36-x64"
CBC_FILE: Cbc-%CBC_VERSION%-win32-msvc14.zip
- PYTHON: "C:\\Python37-x64"
CBC_FILE: Cbc-%CBC_VERSION%-win32-msvc15.zip
install:
# We need wheel installed to build wheels
- "%PYTHON%\\python.exe -m pip install wheel"
# Install CBC
- mkdir Cbc
- cd Cbc
- curl -LfsS -o %CBC_FILE% https://bintray.com/coin-or/download/download_file?file_path=%CBC_FILE%
- 7z x %CBC_FILE%
- cd ..
# Install SWIG
- curl -LfsS -o swigwin-4.0.0.zip https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.0.0/swigwin-4.0.0.zip
- 7z x swigwin-4.0.0.zip
build: off
test_script:
# Build cbcpy
- "%PYTHON%\\python.exe setup.py build_ext --swig=swigwin-4.0.0\\swig.exe"
after_test:
- "%PYTHON%\\python.exe setup.py bdist_wheel"
artifacts:
# bdist_wheel puts your built wheel in the dist directory
- path: dist\*
#on_success:
# You can use this step to upload your artifacts to a public website.
# See Appveyor's documentation for more details. Or you can simply
# access your wheels from the Appveyor "artifacts" tab for your build.
--- a/Cbc/include/coin/CbcModel.hpp 2019-06-15 03:04:50.000000000 +0000
+++ b/Cbc/include/coin/CbcModel.hpp 2019-08-07 21:51:54.753624098 +0000
--- a/Cbc/include/coin/CbcModel.hpp
+++ b/Cbc/include/coin/CbcModel.hpp
@@ -2346,10 +2346,10 @@
{
return master_;
......
--- a/Cbc/include/coin/OsiClpSolverInterface.hpp 2019-06-15 02:56:22.000000000 +0000
+++ b/Cbc/include/coin/OsiClpSolverInterface.hpp 2019-08-07 21:53:40.886632449 +0000
--- a/Cbc/include/coin/OsiClpSolverInterface.hpp
+++ b/Cbc/include/coin/OsiClpSolverInterface.hpp
@@ -174,13 +174,9 @@
and can be queried by other methods.
*/
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Coin-or CBC native interface for Python
# Coin-or CBC native interface for Python
# Copyright (C) 2019 Patrik Dufresne Service Logiciel <info@patrikdufresne.com>
#
# This program is free software; you can redistribute it and/or
......@@ -20,10 +19,12 @@
import os
try:
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
except ImportError:
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
# Configure the SWIG build
CBC_DIR = os.environ.get('CBC_DIR', './Cbc')
......@@ -39,12 +40,30 @@ if os.name == 'nt':
else:
extra_objects = ['%s/lib%s.a' % (library_dirs[0], l) for l in libraries]
libraries = []
swig_opts=['-c++','-doxygen']
swig_opts = ['-c++', '-doxygen']
swig_opts.extend(['-I%s' % i for i in include_dirs])
# Define project description
project_dir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(project_dir, 'README.md')) as f:
# Extend build_ext to patch the include files.
class cbc_build_ext(_build_ext):
def _patch_headers(self):
import patch
patches_dir = os.path.join(os.path.dirname(__file__), 'patches')
for f in os.listdir(patches_dir):
f = os.path.join(patches_dir, f)
pset = patch.fromfile(f)
if not pset.apply(strip=2, root=CBC_DIR):
print('fail to patch file: ' + f)
def run(self):
self._patch_headers()
_build_ext.run(self)
# Define project description from README.md
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f:
long_description = f.read()
setup(
......@@ -56,7 +75,8 @@ setup(
author='Patrik Dufresne',
author_email='info@patrikdufresne.com',
url='https://git.patrikdufresne.com/pdsl/cbcpy',
license="",
license="LGPL",
cmdclass={'build_ext': cbc_build_ext},
ext_modules=[Extension(
'_cbcpy',
['cbcpy.i'],
......@@ -66,4 +86,5 @@ setup(
libraries=libraries,
extra_objects=extra_objects)],
py_modules=['cbcpy'],
)
\ No newline at end of file
setup_requires=['patch'],
)