A short term fix for editable mode install failed to import root level module such as exir#9818
A short term fix for editable mode install failed to import root level module such as exir#9818larryliu0820 merged 6 commits intomainfrom
Conversation
…l 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:
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9818
Note: Links to docs will display an error until the docs builds have been completed. ⏳ 3 Pending, 1 Unrelated FailureAs of commit f599c9f with merge base b66c319 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
|
Why only exir? What if we have a symlink from |
Gee, I think that's better. I don't think we should symlink the whole root directory, instead we probably want to symlink all next level directories with python file. |
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Actually tested Same problem so in this update I symlink'd all the modules |
|
@mergennachin you probably want to take a look at this |
…l module such as exir (#9818) 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 effectively gets `exir` out from the root level package. 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:
Summary:
Fixes #9558.
The
src/executorch/exirfile exists primarily due to the limitations ofpip installin 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.To work around this limitation, a symlink is used. With this symlink and this package entry in
pyproject.toml:We are telling
pip install -e .to treatsrc/executorchas the root of theexecutorchpackage and hence mappingexecutorch.exirtosrc/executorch/exir. This effectively getsexirout from the root level package.This allows us to perform
pip install -e .successfully and enables the execution of the following command:python -c "from executorch.exir import CaptureConfig"Test Plan:
./install_executorch.sh --pybind --editable python -c "from executorch.exir import CaptureConfig"Reviewers:
Subscribers:
Tasks:
Tags: