mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-18 18:04:31 +08:00
chore(build): rely on integrated setuptools_scm instead of manual call (#2032)
* dont manually call setuptools_scm - its integrated setuptools_scm automatically set the version attribute - manually setting it wrong * fix(docs): set fallback version for setuptools-scm to fix autodoc import errors on Read the Docs --------- Co-authored-by: SunsetWolf <Lv.Linlang@hotmail.com>
This commit is contained in:
committed by
GitHub
parent
66c36226aa
commit
ac3fe9476f
2
Makefile
2
Makefile
@@ -113,7 +113,7 @@ dev: prerequisite all
|
|||||||
|
|
||||||
# Check lint with black.
|
# Check lint with black.
|
||||||
black:
|
black:
|
||||||
black . -l 120 --check --diff
|
black . -l 120 --check --diff --exclude qlib/_version.py
|
||||||
|
|
||||||
# Check code folder with pylint.
|
# Check code folder with pylint.
|
||||||
# TODO: These problems we will solve in the future. Important among them are: W0221, W0223, W0237, E1102
|
# TODO: These problems we will solve in the future. Important among them are: W0221, W0223, W0237, E1102
|
||||||
|
|||||||
@@ -117,3 +117,4 @@ qrun = "qlib.cli.run:run"
|
|||||||
[tool.setuptools_scm]
|
[tool.setuptools_scm]
|
||||||
local_scheme = "no-local-version"
|
local_scheme = "no-local-version"
|
||||||
version_scheme = "guess-next-dev"
|
version_scheme = "guess-next-dev"
|
||||||
|
write_to = "qlib/_version.py"
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ from pathlib import Path
|
|||||||
|
|
||||||
from setuptools_scm import get_version
|
from setuptools_scm import get_version
|
||||||
|
|
||||||
|
try:
|
||||||
|
from ._version import version as __version__
|
||||||
|
except ImportError:
|
||||||
__version__ = get_version(root="..", relative_to=__file__)
|
__version__ = get_version(root="..", relative_to=__file__)
|
||||||
__version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version
|
__version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version
|
||||||
import logging
|
import logging
|
||||||
|
|||||||
10
setup.py
10
setup.py
@@ -2,22 +2,12 @@ import os
|
|||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
from setuptools import Extension, setup
|
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()
|
NUMPY_INCLUDE = numpy.get_include()
|
||||||
|
|
||||||
|
|
||||||
VERSION = get_version(root=".", relative_to=__file__)
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
version=VERSION,
|
|
||||||
ext_modules=[
|
ext_modules=[
|
||||||
Extension(
|
Extension(
|
||||||
"qlib.data._libs.rolling",
|
"qlib.data._libs.rolling",
|
||||||
|
|||||||
Reference in New Issue
Block a user