From 2281ef56734dcefeb9537f140d41bb967f011c78 Mon Sep 17 00:00:00 2001 From: Antonin RAFFIN Date: Thu, 7 May 2020 17:27:13 +0200 Subject: [PATCH] Read version from file --- docs/conf.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 5ddbbb7..424ee5e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -43,9 +43,10 @@ class Mock(MagicMock): MOCK_MODULES = [] sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) - -import stable_baselines3 - +# Read version from file +version_file = os.path.join(os.path.dirname(__file__), '../stable_baselines3', 'version.txt') +with open(version_file, 'r') as file_handler: + __version__ = file_handler.read().strip() # -- Project information ----------------------------------------------------- @@ -54,9 +55,9 @@ copyright = '2020, Stable Baselines3' author = 'Stable Baselines3 Contributors' # The short X.Y version -version = 'master (' + stable_baselines3.__version__ + ' )' +version = 'master (' + __version__ + ' )' # The full version, including alpha/beta/rc tags -release = stable_baselines3.__version__ +release = __version__ # -- General configuration ---------------------------------------------------