1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-05 20:11:08 +08:00

ci: auto release (#1985)

* 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
This commit is contained in:
Linlang
2025-08-18 17:28:00 +08:00
committed by GitHub
parent da920b7f95
commit 2d05a705e3
15 changed files with 207 additions and 142 deletions

View File

@@ -1,7 +1,9 @@
from setuptools import setup, Extension
import numpy
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__))
@@ -9,18 +11,10 @@ def read(rel_path: str) -> str:
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")
VERSION = get_version(root=".", relative_to=__file__)
setup(
version=VERSION,