-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathsetup.py
More file actions
72 lines (59 loc) · 1.91 KB
/
setup.py
File metadata and controls
72 lines (59 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import os
import sys
import warnings
from distutils.core import Extension
from setuptools import find_packages, setup
class getPybindInclude(object):
"""Helper class to determine the pybind11 include path
The purpose of this class is to postpone importing pybind11
until it is actually installed, so that the ``get_include()``
method can be invoked.
https://github.com/pybind/python_example/blob/master/setup.py
"""
def __init__(self, user=False):
self.user = user
def __str__(self):
import pybind11
return pybind11.get_include(self.user)
extra_compile_args = ["--std=c++11", "-fPIC", "-v", "-O3", "-shared", "-Landor"]
extra_link_args = ["-Wl,-rpath,."]
includes = [getPybindInclude(), getPybindInclude(user=True)]
ext_modules = []
if sys.platform == "linux": # The andor library is only available on Linux
root_path = os.path.dirname(__file__)
ANDOR_WRAPPER_PATH = root_path + "/evora/andor_wrapper.cpp"
ext_modules = [
Extension(
"evora.andor_wrapper",
sources=[ANDOR_WRAPPER_PATH],
libraries=["andor"],
include_dirs=includes,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
optional=True,
)
]
# Works with Python 3.13.0
setup(
name="evora",
version="0.2.2a0",
description="Package containing PyBind11 wrapper code for the Andor SDK.",
author="Astronomy Undergraduate Engineering Group",
setup_requires=["pybind11"],
install_requires=[
"numpy",
"astropy>=4.0",
"pillow",
"flask[async]",
"gunicorn>=20.1.0",
"flask_cors",
"matplotlib",
"sep-pjw",
"photutils",
"astrometry; platform_system != 'Windows'",
"ambient_api",
"python-dotenv"
],
packages=find_packages(exclude=("tests*")),
ext_modules=ext_modules,
)