mirror of
https://github.com/vale981/stocproc
synced 2025-03-04 09:11:41 -05:00
27 lines
656 B
Python
27 lines
656 B
Python
from Cython.Build import cythonize
|
|
from distutils.command.build_ext import build_ext
|
|
import numpy
|
|
import os
|
|
|
|
|
|
def build(setup_kwargs):
|
|
"""
|
|
This function is mandatory in order to build the extensions.
|
|
"""
|
|
|
|
extensions = ["./stocproc/stocproc_c.pyx"]
|
|
|
|
# gcc arguments hack: enable optimizations
|
|
os.environ["CFLAGS"] = f"-O3 -I{numpy.get_include()}"
|
|
|
|
# Build
|
|
setup_kwargs.update(
|
|
{
|
|
"ext_modules": cythonize(
|
|
extensions,
|
|
language_level=3,
|
|
compiler_directives={"linetrace": True},
|
|
),
|
|
"cmdclass": {"build_ext": build_ext},
|
|
}
|
|
)
|