From fc8c644b773b474f1dbc7a14068efdaf25c73549 Mon Sep 17 00:00:00 2001 From: Guobao Sun Date: Thu, 22 Oct 2026 16:54:32 -0700 Subject: [PATCH] Fix et_replay install in the Python Linting workflow Summary: The `Python Linting` workflow has failed on every pull request since `et_replay/pyproject.toml` changed its `package-dir` from `.` to `et_replay` (#210). That value is right for meta-pytorch/chakra_replay, where `pyproject.toml` sits at the repository root above the `et_replay/` package. In this repository `pyproject.toml` lives inside the package directory, so `pip install et_replay/` fails with `error: package directory 'et_replay' does not exist`. - Install et_replay from a copy staged in the chakra_replay layout, rather than changing `pyproject.toml`, which chakra_replay also uses. - Import `ExecutionTrace` from `et_replay.execution_trace`. The same change emptied the package `__init__.py`, so `from et_replay import ExecutionTrace` no longer works. Differential Revision: D127034812 --- .github/workflows/python_lint.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml index d2706a9f..8767d53a 100644 --- a/.github/workflows/python_lint.yml +++ b/.github/workflows/python_lint.yml @@ -27,13 +27,19 @@ jobs: - name: Run tests run: | python -m pip install -r requirements.txt - python -m pip install et_replay/ + # et_replay/pyproject.toml is laid out for meta-pytorch/chakra_replay, + # where it sits one level above the et_replay package. Install from a + # copy staged in that layout. + mkdir "$RUNNER_TEMP/et_replay_pkg" + cp et_replay/pyproject.toml "$RUNNER_TEMP/et_replay_pkg/" + cp -r et_replay "$RUNNER_TEMP/et_replay_pkg/et_replay" + python -m pip install "$RUNNER_TEMP/et_replay_pkg" python et_replay/tests/test_execution_trace.py - name: Validate imports run: | python -m pip install fbgemm-gpu - python -c 'from et_replay import ExecutionTrace' + python -c 'from et_replay.execution_trace import ExecutionTrace' python -c 'from et_replay.comm import comms_utils' python -c 'from et_replay.tools.validate_trace import TraceValidator' python -c 'from et_replay.utils import trace_handler'