Example #1
0
# flake8: noqa
from setuptools import Extension, find_packages, setup

from glob import iglob

from setup_utils import get_data_files, get_package_data, is_win, is_darwin
from version import __version__


packages = find_packages()
package_data = get_package_data(packages, exclude=('.py', '.pyc', '.cpp', '.h'))
opcode_src = list(iglob("vendor/opcode/**/*.cpp", recursive=True))

compile_args = []
link_args = []
runtime_library_dirs = []
libraries = []
if is_win:
    # see https://github.com/boostorg/python/issues/193 for /DBOOST_ALL_NO_LIB
    compile_args = ["/DICE_NO_DLL", "/DBAN_OPCODE_AUTOLINK", "/DBOOST_ALL_NO_LIB"]
    libraries = ["boost_python36-vc141-mt-x64-1_67", "boost_numpy36-vc141-mt-x64-1_67"]
elif is_darwin:
    link_args = ["-Wl,-rpath,@loader_path"]
    libraries = ["boost_python36", "boost_numpy36"]
else:
    runtime_library_dirs = ["$ORIGIN"]
    libraries = ["boost_python36", "boost_numpy36"]

setup(
    name='pyopcode',
    version=__version__,
Example #2
0
is_win = (sys.platform == 'win32')

build_dir = '../vtkzbhps-build'

if is_win:
    # this is going to pick up all EXEs and importantly DLLs from Scripts
    data_dirs = ["Scripts", "include"]
    site_packages_dir = f"{build_dir}/Lib/site-packages"
else:
    data_dirs = ["bin", "include"]
    site_packages_dir = f"{build_dir}/lib/python{sys.version_info[0]}.{sys.version_info[1]}/site-packages"

# the following should pick up the package itself from site-packages, including PYDs, LIBs and PY files
package_dir = {'': site_packages_dir}
packages = find_packages(site_packages_dir)
package_data = get_package_data(packages, package_dir=package_dir)
# this should pick up the DLLs and binaries from Scripts (windows) / bin (Linux and mac)
data_files = get_data_files(build_dir, data_dirs)

setup(
    name='vtkzbhps',
    version='1.8.3',
    description='Proprietary code for the HPS application',
    author='ZB',
    url='https://github.com/ClinicalGraphics/u3d',
    package_dir=package_dir,
    package_data=package_data,
    packages=packages,
    include_package_data=True,
    data_files=data_files,
    install_requires=[
Example #3
0
# flake8: noqa
from setuptools import Extension, find_packages, setup

from glob import iglob

from setup_utils import get_data_files, get_package_data, is_win, is_darwin
from version import __version__

packages = find_packages()
package_data = get_package_data(packages,
                                exclude=('.py', '.pyc', '.cpp', '.h'))
opcode_src = list(iglob("vendor/opcode/**/*.cpp", recursive=True))

compile_args = []
link_args = []
runtime_library_dirs = []
libraries = []
if is_win:
    # see https://github.com/boostorg/python/issues/193 for /DBOOST_ALL_NO_LIB
    compile_args = [
        "/DICE_NO_DLL", "/DBAN_OPCODE_AUTOLINK", "/DBOOST_ALL_NO_LIB"
    ]
    libraries = [
        "boost_python36-vc141-mt-x64-1_67", "boost_numpy36-vc141-mt-x64-1_67"
    ]
elif is_darwin:
    link_args = ["-Wl,-rpath,@loader_path"]
    libraries = ["boost_python36", "boost_numpy36"]
else:
    runtime_library_dirs = ["$ORIGIN"]
    libraries = ["boost_python36", "boost_numpy36"]