Skip to content

Commit ba044c9

Browse files
authored
Fix read the doc on 2.1. (dmlc#10460)
1 parent 213ebf7 commit ba044c9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

doc/conf.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
TMP_DIR = os.path.join(CURR_PATH, "tmp")
2727
DOX_DIR = "doxygen"
2828

29+
os.environ["XGBOOST_BUILD_DOC"] = "1"
30+
31+
# Version information.
32+
import xgboost # NOQA
33+
34+
version = xgboost.__version__
35+
release = xgboost.__version__
36+
2937

3038
def run_doxygen():
3139
"""Run the doxygen make command in the designated folder."""
@@ -69,7 +77,7 @@ def build_jvm_docs():
6977
elif git_branch == "latest":
7078
git_branch = "master"
7179
elif git_branch == "stable":
72-
git_branch = f"release_{version}"
80+
git_branch = f"release_{xgboost.__version__}"
7381
print(f"git_branch = {git_branch}")
7482

7583
def try_fetch_jvm_doc(branch):
@@ -134,13 +142,6 @@ def is_readthedocs_build():
134142
copyright = "2022, %s" % author
135143
github_doc_root = "https://github.com/dmlc/xgboost/tree/master/doc/"
136144

137-
os.environ["XGBOOST_BUILD_DOC"] = "1"
138-
# Version information.
139-
import xgboost # NOQA
140-
141-
version = xgboost.__version__
142-
release = xgboost.__version__
143-
144145
# Add any Sphinx extension module names here, as strings. They can be
145146
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones
146147
extensions = [

0 commit comments

Comments
 (0)