From 2e6378f241b52c6ce9065897669d394c7117ad00 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Thu, 13 Feb 2020 10:53:25 +0100 Subject: [PATCH] Matrix in conda --- .travis.yml | 3 +- conda-recepie/build.sh | 3 +- conda-recepie/conda_build_config.yaml | 4 +++ conda-recepie/meta.yaml | 27 ++++++++------- python/setup.py | 47 ++++++++++++++------------- 5 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 conda-recepie/conda_build_config.yaml diff --git a/.travis.yml b/.travis.yml index 3e8560e2d..96687308d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,8 @@ os: linux env: matrix: - - CONDA_PY="3.6" - CONDA_PY="3.7" - - CONDA_PY="3.8" + dist: trusty diff --git a/conda-recepie/build.sh b/conda-recepie/build.sh index 1c6474583..dfcad083d 100755 --- a/conda-recepie/build.sh +++ b/conda-recepie/build.sh @@ -13,8 +13,7 @@ cmake .. \ -DSLS_USE_RECEIVER=ON \ -DSLS_USE_GUI=ON \ -DSLS_USE_TESTS=ON \ - -DPYTHON_EXECUTABLE=$CONDA_PREFIX/bin/python \ - -DSLS_USE_PYTHON=ON \ + -DSLS_USE_PYTHON=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DSLS_USE_HDF5=OFF\ diff --git a/conda-recepie/conda_build_config.yaml b/conda-recepie/conda_build_config.yaml new file mode 100644 index 000000000..9c458094d --- /dev/null +++ b/conda-recepie/conda_build_config.yaml @@ -0,0 +1,4 @@ +python: + - 3.6 + - 3.7 + - 3.8 diff --git a/conda-recepie/meta.yaml b/conda-recepie/meta.yaml index 1c3f955bf..e6120865e 100755 --- a/conda-recepie/meta.yaml +++ b/conda-recepie/meta.yaml @@ -15,12 +15,13 @@ requirements: build: - {{ compiler('c') }} - {{compiler('cxx')}} - - python {{python}} + # - python {{python}} - cmake - - qwt 6.* #require qt5 investigate before activating gui - - qt=4.8* - - zeromq=4.2.5=hfc679d8_5 - - pyzmq + - qwt 6 #require qt5 investigate before activating gui + - qt=4.8 + # - zeromq=4.2.5=hfc679d8_5 + - zeromq + # - pyzmq - xorg-libx11 - xorg-libice - xorg-libxext @@ -59,21 +60,23 @@ outputs: run: - libstdcxx-ng - libgcc-ng - - pyzmq + - zeromq - name: slsdet + script: build_pylib.sh requirements: build: - - python {{python}} + - python + - {{ pin_subpackage('slsdetlib', exact=True) }} - setuptools - wheel run: - - python {{python}} + - python - numpy - - slsdetlib=udp + - {{ pin_subpackage('slsdetlib', exact=True) }} test: @@ -84,6 +87,6 @@ outputs: script: copy_gui.sh requirements: run: - - slsdetlib=udp - - qwt 6.* - - qt=4.8.* + - {{ pin_subpackage('slsdetlib', exact=True) }} + - qwt 6 + - qt=4.8 diff --git a/python/setup.py b/python/setup.py index 8163de6ec..9b344406f 100755 --- a/python/setup.py +++ b/python/setup.py @@ -33,30 +33,30 @@ def get_conda_path(): # return pybind11.get_include(self.user) -# ext_modules = [ -# Extension( -# '_sls_detector', -# ['src/main.cpp', -# 'src/enums.cpp', -# 'src/detector.cpp', -# 'src/network.cpp'], -# include_dirs=[ -# # Path to pybind11 headers -# # get_pybind_include(), -# # get_pybind_include(user=True), -# os.path.join(get_conda_path(), 'include/slsDetectorPackage/libs/pybind11'), -# os.path.join(get_conda_path(), 'include/slsDetectorPackage'), +ext_modules = [ + Extension( + '_sls_detector', + ['src/main.cpp', + 'src/enums.cpp', + 'src/detector.cpp', + 'src/network.cpp'], + include_dirs=[ + # Path to pybind11 headers + # get_pybind_include(), + # get_pybind_include(user=True), + os.path.join('../libs/pybind11'), + os.path.join(get_conda_path(), 'include/slsDetectorPackage'), -# ], -# libraries=['SlsDetector', 'SlsReceiver', 'zmq'], -# library_dirs=[ -# os.path.join(get_conda_path(), 'lib'), -# os.path.join(get_conda_path(), 'bin'), -# ], + ], + libraries=['SlsDetector', 'SlsReceiver', 'zmq'], + library_dirs=[ + os.path.join(get_conda_path(), 'lib'), + os.path.join(get_conda_path(), 'bin'), + ], -# language='c++' -# ), -# ] + language='c++' + ), +] # As of Python 3.6, CCompiler has a `has_flag` method. @@ -124,7 +124,8 @@ setup( url='https://github.com/slsdetectorgroup/sls_detector', description='Detector API for SLS Detector Group detectors', long_description='', + ext_modules=ext_modules, packages=['sls_detector'], - data_files = [('', get_shared_lib())], + # data_files = [('', get_shared_lib())], zip_safe=False, )