Skip to content

Commit f4cd549

Browse files
committed
fix build system
1 parent 1f924b2 commit f4cd549

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- name: Set up Python 3.10
6565
uses: actions/setup-python@v5
6666
with:
67-
python-version: 3.10
67+
python-version: "3.10"
6868

6969
- name: Install package
7070
run: |

docs/Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ RUN apt-get update && apt-get install -y \
66
pandoc \
77
&& rm -rf /var/lib/apt/lists/*
88

9-
RUN pip install cebra[docs]
10-
RUN pip uninstall -y cebra
11-
129
COPY docs/requirements.txt .
1310
RUN pip install -r requirements.txt
1411

15-
COPY setup.cfg .
16-
COPY pyproject.toml .
17-
COPY cebra/ .
12+
#COPY setup.cfg .
13+
#COPY pyproject.toml .
14+
#COPY cebra/ .

docs/requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ sphinxcontrib-htmlhelp==2.1.0
1616
sphinxcontrib-jsmath==1.0.1
1717
sphinxcontrib-qthelp==2.0.0
1818
sphinxcontrib-serializinghtml==2.0.0
19+
20+
literate_dataclasses
21+
# For IPython.sphinxext.ipython_console_highlighting extension
22+
ipython
23+
numpy

docs/source/conf.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828

2929
import datetime
3030
import os
31+
import pathlib
3132
import sys
3233

3334
sys.path.insert(0, os.path.abspath("."))
3435

35-
import cebra # noqa: E402
36-
3736

3837
def get_years(start_year=2021):
3938
year = datetime.datetime.now().year
@@ -47,8 +46,17 @@ def get_years(start_year=2021):
4746
project = "cebra"
4847
copyright = f"""{get_years(2021)}"""
4948
author = "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

@@ -119,7 +127,8 @@ def get_years(start_year=2021):
119127

120128
autodoc_member_order = "bysource"
121129
autodoc_mock_imports = [
122-
"torch", "nlb_tools", "tqdm", "h5py", "pandas", "matplotlib", "plotly"
130+
"torch", "nlb_tools", "tqdm", "h5py", "pandas", "matplotlib", "plotly",
131+
"joblib", "scikit-learn", "scipy", "requests", "sklearn"
123132
]
124133
# autodoc_typehints = "none"
125134

0 commit comments

Comments
 (0)