Skip to content

Commit 3cd2971

Browse files
committed
Python3 only and libboost finding robustness increased.
1 parent d96566b commit 3cd2971

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env python
22

3-
# version: 0.2.5
3+
# version: 0.2.6
44
# Many thanks to simplejson for the idea on how to install c++-extention module optionally!
55
# https://pypi.python.org/pypi/simplejson/
66

77
import os
88
import sys
9+
from ctypes.util import find_library
910
from distutils.command.build_ext import build_ext
1011
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError
1112

@@ -45,6 +46,9 @@ def read(fname):
4546
boost_python_library = 'boost_python'
4647
else:
4748
boost_python_library = 'boost_python-py' + str(sys.version_info.major) + str(sys.version_info.minor)
49+
if not find_library(boost_python_library):
50+
# exact version not find, trying with major fit only as fallback
51+
boost_python_library = 'boost_python-py' + str(sys.version_info.major)
4852

4953
maxflow = Extension('medpy.graphcut.maxflow',
5054
define_macros = [('MAJOR_VERSION', '0'),
@@ -126,9 +130,8 @@ def run_setup(with_compilation):
126130
#'Operating System :: Microsoft :: Windows',
127131
'Operating System :: POSIX',
128132
'Operating System :: Unix',
129-
'Programming Language :: Python :: 2',
130-
'Programming Language :: Python :: 2.6',
131-
'Programming Language :: Python :: 2.7',
133+
'Programming Language :: Python :: 3.5',
134+
'Programming Language :: Python :: 3.6',
132135
'Programming Language :: C++',
133136
'Topic :: Scientific/Engineering :: Medical Science Apps.',
134137
'Topic :: Scientific/Engineering :: Image Recognition'

0 commit comments

Comments
 (0)