2828
2929import datetime
3030import os
31+ import pathlib
3132import sys
3233
3334sys .path .insert (0 , os .path .abspath ("." ))
3435
35- import cebra # noqa: E402
36-
3736
3837def get_years (start_year = 2021 ):
3938 year = datetime .datetime .now ().year
@@ -47,8 +46,17 @@ def get_years(start_year=2021):
4746project = "cebra"
4847copyright = f"""{ get_years (2021 )} """
4948author = "See AUTHORS.md"
50- # The full version, including alpha/beta/rc tags
51- release = cebra .__version__
49+ version_file = pathlib .Path (
50+ __file__ ).parent .parent .parent / "cebra" / "__init__.py"
51+ assert version_file .exists (), f"Could not find version file: { version_file } "
52+ with version_file .open ("r" ) as f :
53+ for line in f :
54+ if line .startswith ("__version__" ):
55+ version = line .split ("=" )[1 ].strip ().strip ('"' ).strip ("'" )
56+ print ("Building docs for version:" , version )
57+ break
58+ else :
59+ raise ValueError ("Could not find version in __init__.py" )
5260
5361# -- General configuration ---------------------------------------------------
5462
@@ -120,7 +128,7 @@ def get_years(start_year=2021):
120128autodoc_member_order = "bysource"
121129autodoc_mock_imports = [
122130 "torch" , "nlb_tools" , "tqdm" , "h5py" , "pandas" , "matplotlib" , "plotly" ,
123- "cvxpy" , "captum"
131+ "cvxpy" , "captum" , "joblib" , "scikit-learn" , "scipy" , "requests" , "sklearn"
124132]
125133# autodoc_typehints = "none"
126134
0 commit comments