-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathsetup.py
More file actions
56 lines (46 loc) · 1.38 KB
/
setup.py
File metadata and controls
56 lines (46 loc) · 1.38 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
from setuptools import setup, find_packages, Extension
from Cython.Build import cythonize
import numpy
import os
import platform
# Compiler arguments
extra_compile_args = ["-O3", "-ffast-math"]
if platform.machine() not in ["arm64", "aarch64"]:
extra_compile_args.append("-march=native")
def readme():
with open("README.md", "r") as f:
return f.read()
def read_version():
version_file = os.path.join("src", "bayesbay", "_version.py")
with open(version_file, "r") as f:
lines = f.read()
for line in lines.split("\n"):
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
raise RuntimeError("Unable to find version string.")
ext_modules = [
Extension(
name="bayesbay._utils_1d",
sources=["src/bayesbay/_utils_1d.pyx"],
extra_compile_args=extra_compile_args,
language="c++",
)
]
setup(
name="bayesbay",
version=read_version(),
long_description=readme(),
long_description_content_type="text/markdown",
packages=find_packages(where="src"),
package_dir={"": "src"},
install_requires=[
"numpy>=1.22",
"scipy>=1.9.0",
"matplotlib>=3.0.0",
"shapely>=2.0.0",
"joblib>=1.3.2",
],
ext_modules=cythonize(ext_modules, language_level="3"),
include_dirs=[numpy.get_include()],
)