Skip to content

[misc] refactor: remove sys.path hacks; rely on installed package layout#64

Merged
0oshowero0 merged 2 commits intoAscend:mainfrom
ji-huazhong:cleanup
Mar 29, 2026
Merged

[misc] refactor: remove sys.path hacks; rely on installed package layout#64
0oshowero0 merged 2 commits intoAscend:mainfrom
ji-huazhong:cleanup

Conversation

@ji-huazhong
Copy link
Copy Markdown
Collaborator

  • 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.

@ascend-robot
Copy link
Copy Markdown

CLA Signature Guide

@ji-huazhong , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
50c74dfb Remove sys.path hacks; rely on i... the email used in the commit is not linked to a signed CLA!
please verify that it matches the email you used when signing the 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 /check-cla to revalidate CLA status.

@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

ji-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>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

ji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@ji-huazhong ji-huazhong changed the title Remove sys.path hacks; rely on installed package layout [misc] refactor: remove sys.path hacks; rely on installed package layout Mar 29, 2026
Signed-off-by: ji-huazhong <hzji210@gmail.com>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

ji-huazhong, thanks for your pull request. All authors of the commits have signed the CLA. 👍

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: E402 suppressions.
  • 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.

@0oshowero0 0oshowero0 merged commit 590f4d6 into Ascend:main Mar 29, 2026
12 checks passed
@ji-huazhong ji-huazhong deleted the cleanup branch March 29, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants