Skip to content

Commit 79a4ba0

Browse files
dbortfacebook-github-bot
authored andcommitted
Make docs build use the install pip package (#2678)
Summary: Before now, the docs execution environment was adding the source tree to the import path instead of using the installed pip files. Also, it added the `executorch` directory, making it possible to refer to packages like `sdk.bundled_program` instead of `executorch.sdk.bundled_program`. Stop adding the source directories to the path, and fix up imports. Pull Request resolved: #2678 Test Plan: ``` cd docs/source make html ``` Reviewed By: Jack-Khuu Differential Revision: D55351005 Pulled By: dbort fbshipit-source-id: 2331bac1fbb751f60858d50e833a7500fc2081d4
1 parent cf83964 commit 79a4ba0

File tree

5 files changed

+16
-19
lines changed

5 files changed

+16
-19
lines changed

docs/source/conf.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525

2626
import pytorch_sphinx_theme
2727

28+
# To let us import ./custom_directives.py
2829
sys.path.insert(0, os.path.abspath("."))
29-
sys.path.insert(0, os.path.abspath("../../.."))
30-
sys.path.insert(0, os.path.abspath("../.."))
3130
# -- Project information -----------------------------------------------------
3231

3332
project = "ExecuTorch"
@@ -44,8 +43,6 @@
4443
import os
4544
import sys
4645

47-
sys.path.insert(0, os.path.abspath("../../"))
48-
4946
extensions = [
5047
"breathe",
5148
"sphinx.ext.autodoc",

docs/source/export-to-executorch-api-reference.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Export to ExecuTorch API Reference
22
----------------------------------
33

4-
.. automodule:: exir
4+
.. automodule:: executorch.exir
55
.. autofunction:: to_edge
66

77
.. autoclass:: EdgeProgramManager
@@ -10,7 +10,7 @@ Export to ExecuTorch API Reference
1010
.. autoclass:: ExecutorchProgramManager
1111
:members: methods, config_methods, exported_program, buffer, debug_handle_map, dump_executorch_program
1212

13-
.. automodule:: exir.backend.backend_api
13+
.. automodule:: executorch.exir.backend.backend_api
1414
.. autofunction:: to_backend
1515

1616
.. autoclass:: LoweredBackendModule

docs/source/sdk-bundled-io.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ In `BundledProgram`, we create two new classes, `MethodTestCase` and `MethodTest
2626
:::{dropdown} `MethodTestCase`
2727

2828
```{eval-rst}
29-
.. autofunction:: bundled_program.config.MethodTestCase.__init__
29+
.. autofunction:: executorch.sdk.bundled_program.config.MethodTestCase.__init__
3030
:noindex:
3131
```
3232
:::
3333

3434
:::{dropdown} `MethodTestSuite`
3535

3636
```{eval-rst}
37-
.. autofunction:: bundled_program.config.MethodTestSuite
37+
.. autofunction:: executorch.sdk.bundled_program.config.MethodTestSuite
3838
:noindex:
3939
```
4040
:::
@@ -49,7 +49,7 @@ We provide `create_bundled_program` API under `executorch/sdk/bundled_program/co
4949
:::{dropdown} `BundledProgram`
5050

5151
```{eval-rst}
52-
.. currentmodule:: bundled_program.core
52+
.. currentmodule:: executorch.sdk.bundled_program.core
5353
.. autofunction:: create_bundled_program
5454
:noindex:
5555
```
@@ -66,13 +66,13 @@ To serialize `BundledProgram` to make runtime APIs use it, we provide two APIs,
6666
:::{dropdown} Serialize and Deserialize
6767

6868
```{eval-rst}
69-
.. currentmodule:: bundled_program.serialize
69+
.. currentmodule:: executorch.sdk.bundled_program.serialize
7070
.. autofunction:: serialize_from_bundled_program_to_flatbuffer
7171
:noindex:
7272
```
7373

7474
```{eval-rst}
75-
.. currentmodule:: bundled_program.serialize
75+
.. currentmodule:: executorch.sdk.bundled_program.serialize
7676
.. autofunction:: deserialize_from_flatbuffer_to_bundled_program
7777
:noindex:
7878
```

docs/source/sdk-etrecord.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ they are interested in working with via our tooling.
3131
.. warning::
3232
Users should do a deepcopy of the output of to_edge() and pass in the deepcopy to the generate_etrecord API. This is needed because the subsequent call, to_executorch(), does an in-place mutation and will lose debug data in the process.
3333

34-
.. currentmodule:: sdk.etrecord._etrecord
34+
.. currentmodule:: executorch.sdk.etrecord._etrecord
3535
.. autofunction:: generate_etrecord
3636

3737
Using an ``ETRecord``

docs/source/sdk-inspector.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Inspector Methods
2626
Constructor
2727
~~~~~~~~~~~
2828

29-
.. autofunction:: sdk.Inspector.__init__
29+
.. autofunction:: executorch.sdk.Inspector.__init__
3030

3131
**Example Usage:**
3232

@@ -39,13 +39,13 @@ Constructor
3939
to_dataframe
4040
~~~~~~~~~~~~~~~~
4141

42-
.. autofunction:: sdk.Inspector.to_dataframe
42+
.. autofunction:: executorch.sdk.Inspector.to_dataframe
4343

4444

4545
print_data_tabular
4646
~~~~~~~~~~~~~~~~~~
4747

48-
.. autofunction:: sdk.Inspector.print_data_tabular
48+
.. autofunction:: executorch.sdk.Inspector.print_data_tabular
4949

5050
.. _example-usage-1:
5151

@@ -61,7 +61,7 @@ print_data_tabular
6161
find_total_for_module
6262
~~~~~~~~~~~~~~~~~~~~~
6363

64-
.. autofunction:: sdk.Inspector.find_total_for_module
64+
.. autofunction:: executorch.sdk.Inspector.find_total_for_module
6565

6666
.. _example-usage-2:
6767

@@ -79,7 +79,7 @@ find_total_for_module
7979
get_exported_program
8080
~~~~~~~~~~~~~~~~~~~~
8181

82-
.. autofunction:: sdk.Inspector.get_exported_program
82+
.. autofunction:: executorch.sdk.Inspector.get_exported_program
8383

8484
.. _example-usage-3:
8585

@@ -118,15 +118,15 @@ of an ``Inspector`` instance, for example:
118118
119119
inspector.event_blocks
120120
121-
.. autoclass:: sdk.inspector.inspector.EventBlock
121+
.. autoclass:: executorch.sdk.inspector.EventBlock
122122

123123
``Event`` Class
124124
~~~~~~~~~~~~~~~
125125

126126
Access ``Event`` instances through the ``events`` attribute of an
127127
``EventBlock`` instance.
128128

129-
.. autoclass:: sdk.inspector.inspector.Event
129+
.. autoclass:: executorch.sdk.inspector.Event
130130

131131
**Example Usage:**
132132

0 commit comments

Comments
 (0)