Skip to content

Commit 7ca4c23

Browse files
chore: Build Python protos during sphinx build (#3123)
* Fix configuration for sphinx to build Python protos Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Add RTD docs Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Add back package Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Change to not use `make` Signed-off-by: Felix Wang <wangfelix98@gmail.com> Signed-off-by: Felix Wang <wangfelix98@gmail.com>
1 parent 3910a9c commit 7ca4c23

6 files changed

+113
-16
lines changed

sdk/python/docs/conf.py

+23
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,29 @@
2525
sys.path.insert(0, os.path.abspath("../.."))
2626

2727

28+
# -- Build protos ---------------------------------------------------------
29+
30+
# For an unknown reason, the Python protos stopped being built correctly.
31+
# See https://readthedocs.org/projects/feast/builds/17686555/ for an
32+
# example where the Python protos did not build, which subsequently broke
33+
# the RTD build. In order to fix this, we manually compile the protos.
34+
import subprocess
35+
36+
from pathlib import Path
37+
38+
# cwd will be feast/sdk/python/docs/source
39+
cwd = Path(os.getcwd())
40+
41+
# Change to feast/
42+
os.chdir(cwd.parent.parent.parent.parent)
43+
44+
# Compile Python protos
45+
result = subprocess.run(["python", "setup.py", "build_python_protos", "--inplace"], capture_output=True)
46+
stdout = result.stdout.decode("utf-8")
47+
stderr = result.stderr.decode("utf-8")
48+
print(f"Apply stdout:\n{stdout}")
49+
print(f"Apply stderr:\n{stderr}")
50+
2851
# -- General configuration ------------------------------------------------
2952

3053
# If your documentation needs a minimal Sphinx version, state it here.

sdk/python/docs/source/conf.py

+23
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,29 @@
2525
sys.path.insert(0, os.path.abspath("../.."))
2626

2727

28+
# -- Build protos ---------------------------------------------------------
29+
30+
# For an unknown reason, the Python protos stopped being built correctly.
31+
# See https://readthedocs.org/projects/feast/builds/17686555/ for an
32+
# example where the Python protos did not build, which subsequently broke
33+
# the RTD build. In order to fix this, we manually compile the protos.
34+
import subprocess
35+
36+
from pathlib import Path
37+
38+
# cwd will be feast/sdk/python/docs/source
39+
cwd = Path(os.getcwd())
40+
41+
# Change to feast/
42+
os.chdir(cwd.parent.parent.parent.parent)
43+
44+
# Compile Python protos
45+
result = subprocess.run(["python", "setup.py", "build_python_protos", "--inplace"], capture_output=True)
46+
stdout = result.stdout.decode("utf-8")
47+
stderr = result.stderr.decode("utf-8")
48+
print(f"Apply stdout:\n{stdout}")
49+
print(f"Apply stderr:\n{stderr}")
50+
2851
# -- General configuration ------------------------------------------------
2952

3053
# If your documentation needs a minimal Sphinx version, state it here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
feast.infra.offline\_stores.contrib.mssql\_offline\_store package
2+
=================================================================
3+
4+
Subpackages
5+
-----------
6+
7+
.. toctree::
8+
:maxdepth: 4
9+
10+
feast.infra.offline_stores.contrib.mssql_offline_store.tests
11+
12+
Submodules
13+
----------
14+
15+
feast.infra.offline\_stores.contrib.mssql\_offline\_store.mssql module
16+
----------------------------------------------------------------------
17+
18+
.. automodule:: feast.infra.offline_stores.contrib.mssql_offline_store.mssql
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
feast.infra.offline\_stores.contrib.mssql\_offline\_store.mssqlserver\_source module
24+
------------------------------------------------------------------------------------
25+
26+
.. automodule:: feast.infra.offline_stores.contrib.mssql_offline_store.mssqlserver_source
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
Module contents
32+
---------------
33+
34+
.. automodule:: feast.infra.offline_stores.contrib.mssql_offline_store
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
feast.infra.offline\_stores.contrib.mssql\_offline\_store.tests package
2+
=======================================================================
3+
4+
Submodules
5+
----------
6+
7+
feast.infra.offline\_stores.contrib.mssql\_offline\_store.tests.data\_source module
8+
-----------------------------------------------------------------------------------
9+
10+
.. automodule:: feast.infra.offline_stores.contrib.mssql_offline_store.tests.data_source
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
Module contents
16+
---------------
17+
18+
.. automodule:: feast.infra.offline_stores.contrib.mssql_offline_store.tests
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:

sdk/python/docs/source/feast.infra.offline_stores.contrib.rst

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Subpackages
88
:maxdepth: 4
99

1010
feast.infra.offline_stores.contrib.athena_offline_store
11+
feast.infra.offline_stores.contrib.mssql_offline_store
1112
feast.infra.offline_stores.contrib.postgres_offline_store
1213
feast.infra.offline_stores.contrib.spark_offline_store
1314
feast.infra.offline_stores.contrib.trino_offline_store
@@ -23,6 +24,14 @@ feast.infra.offline\_stores.contrib.athena\_repo\_configuration module
2324
:undoc-members:
2425
:show-inheritance:
2526

27+
feast.infra.offline\_stores.contrib.mssql\_repo\_configuration module
28+
---------------------------------------------------------------------
29+
30+
.. automodule:: feast.infra.offline_stores.contrib.mssql_repo_configuration
31+
:members:
32+
:undoc-members:
33+
:show-inheritance:
34+
2635
feast.infra.offline\_stores.contrib.postgres\_repo\_configuration module
2736
------------------------------------------------------------------------
2837

sdk/python/docs/source/feast.protos.feast.serving.rst

-16
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,6 @@ feast.protos.feast.serving.Connector\_pb2\_grpc module
2020
:undoc-members:
2121
:show-inheritance:
2222

23-
feast.protos.feast.serving.LoggingService\_pb2 module
24-
-----------------------------------------------------
25-
26-
.. automodule:: feast.protos.feast.serving.LoggingService_pb2
27-
:members:
28-
:undoc-members:
29-
:show-inheritance:
30-
31-
feast.protos.feast.serving.LoggingService\_pb2\_grpc module
32-
-----------------------------------------------------------
33-
34-
.. automodule:: feast.protos.feast.serving.LoggingService_pb2_grpc
35-
:members:
36-
:undoc-members:
37-
:show-inheritance:
38-
3923
feast.protos.feast.serving.ServingService\_pb2 module
4024
-----------------------------------------------------
4125

0 commit comments

Comments
 (0)