mirror of
https://github.com/microsoft/qlib.git
synced 2026-06-06 14:01:28 +08:00
* ci: auto release * fix: bug getting version in qlib/__init__.py * fix: bug getting version in setup.py * fix: bug getting version in qlib/__init__.py * fix: make the code in CI more complete * fix: specify the root directory in the get_verison method * fix: parameter error * update: optimize code && add comments
36 lines
807 B
Python
36 lines
807 B
Python
import os
|
|
|
|
import numpy
|
|
from setuptools import Extension, setup
|
|
from setuptools_scm import get_version
|
|
|
|
|
|
def read(rel_path: str) -> str:
|
|
here = os.path.abspath(os.path.dirname(__file__))
|
|
with open(os.path.join(here, rel_path), encoding="utf-8") as fp:
|
|
return fp.read()
|
|
|
|
|
|
NUMPY_INCLUDE = numpy.get_include()
|
|
|
|
|
|
VERSION = get_version(root=".", relative_to=__file__)
|
|
|
|
setup(
|
|
version=VERSION,
|
|
ext_modules=[
|
|
Extension(
|
|
"qlib.data._libs.rolling",
|
|
["qlib/data/_libs/rolling.pyx"],
|
|
language="c++",
|
|
include_dirs=[NUMPY_INCLUDE],
|
|
),
|
|
Extension(
|
|
"qlib.data._libs.expanding",
|
|
["qlib/data/_libs/expanding.pyx"],
|
|
language="c++",
|
|
include_dirs=[NUMPY_INCLUDE],
|
|
),
|
|
],
|
|
)
|