mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
WIP
This commit is contained in:
parent
bc187bb198
commit
d9a50ad9f4
@ -1,8 +1,8 @@
|
|||||||
python:
|
python:
|
||||||
- 3.8
|
# - 3.8
|
||||||
- 3.9
|
# - 3.9
|
||||||
- 3.10
|
# - 3.10
|
||||||
- 3.11
|
# - 3.11
|
||||||
- 3.12
|
# - 3.12
|
||||||
- 3.13
|
- 3.13
|
||||||
|
|
||||||
|
@ -66,30 +66,32 @@ outputs:
|
|||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
|
|
||||||
- name: slsdet
|
- name: slsdet
|
||||||
script: build_pylib.sh
|
script:
|
||||||
|
- unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv # [not win]
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
build:
|
build:
|
||||||
- python
|
- python {{python}}
|
||||||
- {{ compiler('c') }}
|
- {{ compiler('c') }}
|
||||||
- {{compiler('cxx')}}
|
- {{compiler('cxx')}}
|
||||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
# - {{ pin_subpackage('slsdetlib', exact=True) }} #discuss keeping pinning for simplicity?
|
||||||
- setuptools
|
- pybind11>=2.13
|
||||||
- pybind11=2.13
|
|
||||||
|
|
||||||
host:
|
host:
|
||||||
- python
|
- cmake
|
||||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
- ninja
|
||||||
|
- python {{python}}
|
||||||
|
- pip
|
||||||
- setuptools
|
- setuptools
|
||||||
- pybind11=2.13
|
- pybind11>=2.13
|
||||||
|
- scikit-build-core
|
||||||
|
|
||||||
|
|
||||||
run:
|
run:
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
- python
|
- python {{python}}
|
||||||
- numpy
|
|
||||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
imports:
|
imports:
|
||||||
|
@ -1,77 +0,0 @@
|
|||||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
|
||||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
|
||||||
"""
|
|
||||||
Setup file for slsdet
|
|
||||||
Build upon the pybind11 example found here: https://github.com/pybind/python_example
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
from setuptools import setup, find_packages
|
|
||||||
from pybind11.setup_helpers import Pybind11Extension, build_ext
|
|
||||||
|
|
||||||
def read_version():
|
|
||||||
try:
|
|
||||||
version_file = os.path.join(os.path.dirname(__file__), 'slsdet', 'VERSION')
|
|
||||||
with open(version_file, "r") as f:
|
|
||||||
return f.read().strip()
|
|
||||||
except:
|
|
||||||
raise RuntimeError("VERSION file not found in slsdet package from setup.py.")
|
|
||||||
|
|
||||||
__version__ = read_version()
|
|
||||||
|
|
||||||
|
|
||||||
def get_conda_path():
|
|
||||||
"""
|
|
||||||
Keep this a function if we need some fancier logic later
|
|
||||||
"""
|
|
||||||
print('Prefix: ', os.environ['CONDA_PREFIX'])
|
|
||||||
return os.environ['CONDA_PREFIX']
|
|
||||||
|
|
||||||
|
|
||||||
#TODO migrate to CMake build or fetch files from cmake?
|
|
||||||
ext_modules = [
|
|
||||||
Pybind11Extension(
|
|
||||||
'_slsdet',
|
|
||||||
['src/main.cpp',
|
|
||||||
'src/enums.cpp',
|
|
||||||
'src/current.cpp',
|
|
||||||
'src/detector.cpp',
|
|
||||||
'src/network.cpp',
|
|
||||||
'src/pattern.cpp',
|
|
||||||
'src/scan.cpp',
|
|
||||||
'src/duration.cpp',
|
|
||||||
'src/DurationWrapper.cpp',
|
|
||||||
'src/pedestal.cpp',
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
,
|
|
||||||
include_dirs=[
|
|
||||||
os.path.join(get_conda_path(), 'include'),
|
|
||||||
|
|
||||||
],
|
|
||||||
libraries=['SlsDetector', 'SlsSupport', 'SlsReceiver'],
|
|
||||||
library_dirs=[
|
|
||||||
os.path.join(get_conda_path(), 'lib'),
|
|
||||||
],
|
|
||||||
language='c++'
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name='slsdet',
|
|
||||||
version=__version__,
|
|
||||||
author='Erik Frojdh',
|
|
||||||
author_email='erik.frojdh@psi.ch',
|
|
||||||
url='https://github.com/slsdetectorgroup/slsDetectorPackage',
|
|
||||||
description='Detector API for SLS Detector Group detectors',
|
|
||||||
long_description='',
|
|
||||||
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
|
|
||||||
package_data={
|
|
||||||
'slsdet': ['VERSION'],
|
|
||||||
},
|
|
||||||
ext_modules=ext_modules,
|
|
||||||
cmdclass={"build_ext": build_ext},
|
|
||||||
zip_safe=False,
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user