Skip to content

Commit f167a89

Browse files
committed
A short term fix for editable mode install failed to import root level module such as exir
Summary: Fixes #9558. The `src/executorch/exir` file exists primarily due to the limitations of `pip install` in editable mode. Specifically, `pip install -e .` does not recognize `<executorch root>/exir` (or any root level directory with a `__init__.py`) as a valid package module because of the presence of `<executorch root>/exir/__init__.py`. See the following GitHub issue for details: [Issue #9558](#9558). To work around this limitation, a symlink is used. With this symlink and this package entry in `pyproject.toml`: ```toml [tool.setuptools.package-dir] ... "executorch" = "src/executorch" ``` We are telling `pip install -e .` to treat `src/executorch` as the root of the `executorch` package and hence mapping `executorch.exir` to `src/executorch/exir`. This allows us to perform `pip install -e .` successfully and enables the execution of the following command: ```bash python -c "from executorch.exir import CaptureConfig" ``` Test Plan: ```bash ./install_executorch.sh --pybind --editable python -c "from executorch.exir import CaptureConfig" ``` Reviewers: Subscribers: Tasks: Tags:
1 parent b66c319 commit f167a89

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ flatc = "executorch.data.bin:flatc"
9797
"executorch.examples.apple.coreml.llama" = "examples/apple/coreml/llama"
9898
"executorch.examples.llm_pte_finetuning" = "examples/llm_pte_finetuning"
9999
"executorch.examples.models" = "examples/models"
100-
"executorch.exir" = "exir"
100+
"executorch" = "src/executorch"
101101
"executorch.extension" = "extension"
102102
"executorch.kernels.quantized" = "kernels/quantized"
103103
"executorch.schema" = "schema"

src/executorch/exir

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../exir

0 commit comments

Comments
 (0)