Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
SunsetWolf committed Dec 17, 2024
1 parent 7c9ef8d commit 9b9accd
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# - name: update gcc
# run: |
# yum install -y centos-release-scl
# yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++
- name: Install dependencies
run: |
pip install twine
python -m pip list
- name: Build and publish
run: |
ls dist
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

41 changes: 41 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from setuptools import setup, Extension
import numpy
import os


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()


def get_version(rel_path: str) -> str:
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
raise RuntimeError("Unable to find version string.")


NUMPY_INCLUDE = numpy.get_include()

VERSION = get_version("qlib/__init__.py")


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],
),
]
)

0 comments on commit 9b9accd

Please sign in to comment.