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:
16
setup.py
16
setup.py
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user