[misc] refactor: remove sys.path hacks; rely on installed package layout#64
[misc] refactor: remove sys.path hacks; rely on installed package layout#640oshowero0 merged 2 commits intoAscend:mainfrom
Conversation
CLA Signature Guide@ji-huazhong , thanks for your pull request. The following commit(s) are not associated with a signed Contributor License Agreement (CLA).
To sign CLA, click here. To check if your email is configured correctly, refer to the FAQs. Once you've signed the CLA or updating your email, please comment |
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Drop manual sys.path.append to the repo root in tests, recipe demo, and scripts. Imports from transfer_queue now assume the package is installed (e.g. pip install -e .) or the interpreter path is set correctly. Clean up noqa: E402 on affected imports where applicable. Signed-off-by: ji-huazhong <hzji210@gmail.com>
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Signed-off-by: ji-huazhong <hzji210@gmail.com>
CLA Signature Passji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
There was a problem hiding this comment.
Pull request overview
Refactors tests, scripts, and recipe demos to stop mutating sys.path at runtime and instead rely on transfer_queue being importable via normal installed package layout (e.g., pip install -e .), aligning local usage with CI.
Changes:
- Removed
sys.path.append(...)path hacks across unit tests, e2e tests, scripts, and recipes. - Normalized imports to direct
transfer_queue.*imports and removed now-unnecessary# noqa: E402suppressions. - Minor whitespace cleanup in a storage client factory module.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| transfer_queue/storage/clients/factory.py | Removes stray whitespace line to keep module header/import section clean. |
| tests/test_yuanrong_client_zero_copy.py | Drops repo-root sys.path injection; imports GeneralKVClientAdapter directly and keeps importorskip. |
| tests/test_simple_storage_unit.py | Removes sys.path setup and noqa on first-party imports. |
| tests/test_serial_utils_on_cpu.py | Removes sys.path setup and noqa on first-party imports. |
| tests/test_samplers.py | Removes sys.path setup and noqa on sampler imports. |
| tests/test_ray_p2p.py | Removes sys.path setup and noqa on first-party imports. |
| tests/test_metadata.py | Removes sys.path setup and noqa on metadata imports. |
| tests/test_kv_storage_manager.py | Removes sys.path setup and noqa on first-party imports. |
| tests/test_controller_data_partitions.py | Removes sys.path setup block to rely on installed package imports. |
| tests/test_controller.py | Removes sys.path setup and noqa on controller import. |
| tests/test_client.py | Removes sys.path setup and noqa on first-party imports. |
| tests/test_async_simple_storage_manager.py | Removes sys.path setup and noqa on first-party imports. |
| tests/e2e/test_kv_interface_e2e.py | Removes sys.path setup and imports transfer_queue directly. |
| tests/e2e/test_e2e_lifecycle_consistency.py | Removes sys.path setup to rely on installed package layout. |
| scripts/put_benchmark.py | Removes sys.path setup and noqa on first-party imports. |
| scripts/performance_test/ray_perftest_baseline.py | Removes sys.path setup to rely on installed package layout. |
| scripts/performance_test/perftest.py | Removes sys.path setup and noqa on transfer_queue import. |
| recipe/simple_use_case/single_controller_demo.py | Removes sys.path setup to rely on installed package layout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Drop manual
sys.path.appendto the repo root in tests, recipe demo, and scripts.Imports from transfer_queue now assume the package is installed (e.g. pip install -e .) or the interpreter path is set correctly.
Clean up noqa: E402 on affected imports where applicable.