Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ dev: prerequisite all

# Check lint with black.
black:
black . -l 120 --check --diff
black . -l 120 --check --diff --exclude qlib/_version.py

# Check code folder with pylint.
# TODO: These problems we will solve in the future. Important among them are: W0221, W0223, W0237, E1102
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ qrun = "qlib.cli.run:run"
[tool.setuptools_scm]
local_scheme = "no-local-version"
version_scheme = "guess-next-dev"
write_to = "qlib/_version.py"
5 changes: 4 additions & 1 deletion qlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

from setuptools_scm import get_version

__version__ = get_version(root="..", relative_to=__file__)
try:
from ._version import version as __version__
except ImportError:
__version__ = get_version(root="..", relative_to=__file__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_version shouldn’t be used at runtime - editable install should be used for doc building/testing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the coments, Can you fix this with a new pull request?

__version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version
import logging
import os
Expand Down
10 changes: 0 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

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",
Expand Down
Loading