diff --git a/conda-recepie/build_pylib.sh b/conda-recepie/build_pylib.sh index de022db10..53fc86c99 100755 --- a/conda-recepie/build_pylib.sh +++ b/conda-recepie/build_pylib.sh @@ -15,5 +15,6 @@ echo "|<-------- starting python build" # cp build/bin/_sls_detector* python/. cd python -python setup.py install +${PYTHON} setup.py install +# python setup.py install # $PYTHON setup.py install \ No newline at end of file diff --git a/conda-recepie/meta.yaml b/conda-recepie/meta.yaml index 2d7874c9e..eaae4efe2 100755 --- a/conda-recepie/meta.yaml +++ b/conda-recepie/meta.yaml @@ -72,6 +72,8 @@ outputs: - {{ pin_subpackage('slsdetlib', exact=True) }} - setuptools + host: + - python run: - libstdcxx-ng diff --git a/docs/src/pyexamples.rst b/docs/src/pyexamples.rst index 7b3eb7b1d..e92d05fd9 100755 --- a/docs/src/pyexamples.rst +++ b/docs/src/pyexamples.rst @@ -12,7 +12,7 @@ file writing etc. .. code-block:: python - from sls_detector import Eiger + from slsdet import Eiger d = Eiger() threshold = range(0, 2000, 200) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 203ed90b7..302c9f2cc 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,14 +1,14 @@ # find_package (Python COMPONENTS Interpreter Development) -pybind11_add_module(_sls_detector +pybind11_add_module(_slsdet src/main.cpp src/enums.cpp src/detector.cpp src/network.cpp ) -target_link_libraries(_sls_detector PUBLIC +target_link_libraries(_slsdet PUBLIC slsDetectorShared slsReceiverShared slsSupportLib @@ -16,7 +16,7 @@ target_link_libraries(_sls_detector PUBLIC -set_target_properties(_sls_detector PROPERTIES +set_target_properties(_slsdet PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) @@ -40,8 +40,8 @@ set( PYTHON_FILES ) foreach(FILE ${PYTHON_FILES}) - configure_file( sls_detector/${FILE} - ${CMAKE_BINARY_DIR}/bin/sls_detector/${FILE} ) + configure_file( slsdet/${FILE} + ${CMAKE_BINARY_DIR}/bin/slsdet/${FILE} ) endforeach(FILE ${PYTHON_FILES}) diff --git a/python/setup.py b/python/setup.py index 4c88dde93..5667cd641 100755 --- a/python/setup.py +++ b/python/setup.py @@ -8,7 +8,7 @@ import sys import setuptools import os -__version__ = 'developer' +__version__ = 'udp' def get_conda_path(): @@ -35,7 +35,7 @@ def get_conda_path(): ext_modules = [ Extension( - '_sls_detector', + '_slsdet', ['src/main.cpp', 'src/enums.cpp', 'src/detector.cpp', @@ -111,26 +111,27 @@ class BuildExt(build_ext): for ext in self.extensions: ext.extra_compile_args = opts - print('--------------') + print('**************************************************') print(ct) print(opts) + print('**************************************************') build_ext.build_extensions(self) + def get_shared_lib(): return [f for f in os.listdir('.') if '_sls_detector' in f] setup( - name='slsdetector', + name='slsdet', version=__version__, author='Erik Frojdh', author_email='erik.frojdh@psi.ch', - url='https://github.com/slsdetectorgroup/sls_detector', + url='https://github.com/slsdetectorgroup/slsDetectorPackage', description='Detector API for SLS Detector Group detectors', long_description='', + packages=find_packages(exclude=['contrib', 'docs', 'tests']), ext_modules=ext_modules, cmdclass={'build_ext': BuildExt}, - packages=['sls_detector'], - # data_files = [('', get_shared_lib())], zip_safe=False, ) diff --git a/python/sls_detector/__init__.py b/python/slsdet/__init__.py similarity index 100% rename from python/sls_detector/__init__.py rename to python/slsdet/__init__.py diff --git a/python/sls_detector/adcs.py b/python/slsdet/adcs.py similarity index 100% rename from python/sls_detector/adcs.py rename to python/slsdet/adcs.py diff --git a/python/sls_detector/ctb.py b/python/slsdet/ctb.py similarity index 100% rename from python/sls_detector/ctb.py rename to python/slsdet/ctb.py diff --git a/python/sls_detector/dacs.py b/python/slsdet/dacs.py similarity index 100% rename from python/sls_detector/dacs.py rename to python/slsdet/dacs.py diff --git a/python/sls_detector/decorators.py b/python/slsdet/decorators.py similarity index 100% rename from python/sls_detector/decorators.py rename to python/slsdet/decorators.py diff --git a/python/sls_detector/detector.py b/python/slsdet/detector.py similarity index 100% rename from python/sls_detector/detector.py rename to python/slsdet/detector.py diff --git a/python/sls_detector/detector_property.py b/python/slsdet/detector_property.py similarity index 100% rename from python/sls_detector/detector_property.py rename to python/slsdet/detector_property.py diff --git a/python/sls_detector/eiger.py b/python/slsdet/eiger.py similarity index 100% rename from python/sls_detector/eiger.py rename to python/slsdet/eiger.py diff --git a/python/sls_detector/errors.py b/python/slsdet/errors.py similarity index 100% rename from python/sls_detector/errors.py rename to python/slsdet/errors.py diff --git a/python/sls_detector/jungfrau.py b/python/slsdet/jungfrau.py similarity index 100% rename from python/sls_detector/jungfrau.py rename to python/slsdet/jungfrau.py diff --git a/python/sls_detector/lookup.py b/python/slsdet/lookup.py similarity index 100% rename from python/sls_detector/lookup.py rename to python/slsdet/lookup.py diff --git a/python/sls_detector/mythen3.py b/python/slsdet/mythen3.py similarity index 100% rename from python/sls_detector/mythen3.py rename to python/slsdet/mythen3.py diff --git a/python/sls_detector/registers.py b/python/slsdet/registers.py similarity index 100% rename from python/sls_detector/registers.py rename to python/slsdet/registers.py diff --git a/python/sls_detector/utils.py b/python/slsdet/utils.py similarity index 100% rename from python/sls_detector/utils.py rename to python/slsdet/utils.py diff --git a/python/src/main.cpp b/python/src/main.cpp index 2d3c300d6..48bd1bb06 100755 --- a/python/src/main.cpp +++ b/python/src/main.cpp @@ -19,7 +19,7 @@ void init_enums(py::module &); void init_experimental(py::module &); void init_det(py::module &); void init_network(py::module &); -PYBIND11_MODULE(_sls_detector, m) { +PYBIND11_MODULE(_slsdet, m) { m.doc() = R"pbdoc( C/C++ API -----------------------