[Tests][Hexagon] Lazily import pytest plugin dependencies#19726
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors pytest_plugin.py to lazily import HexagonLauncher and defines a local _is_port_in_use helper function to avoid module-level imports. The review feedback suggests importing HexagonLauncherRPC and Session within a TYPE_CHECKING block to prevent linter and static analysis errors, as they are still used for type annotations. Additionally, it is recommended to lazily import _is_port_in_use from tvm.contrib.hexagon.build inside get_free_port rather than duplicating the function implementation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
87a8bf1 to
4ff6e51
Compare
4ff6e51 to
a15c67c
Compare
This pr makes the Hexagon pytest plugin avoid importing Hexagon build/session machinery at module import time. This keeps pytest collection lightweight and avoids collection-time failures from Hexagon-specific runtime/session imports when running source-tree tests against a TVM wheel or an environment that does not need to execute Hexagon tests. (cherry picked from commit e41454d)
This pr makes the Hexagon pytest plugin avoid importing Hexagon build/session machinery at module import time. This keeps pytest collection lightweight and avoids collection-time failures from Hexagon-specific runtime/session imports when running source-tree tests against a TVM wheel or an environment that does not need to execute Hexagon tests. (cherry picked from commit e41454d)
This pr makes the Hexagon pytest plugin avoid importing Hexagon build/session machinery at module import time.
This keeps pytest collection lightweight and avoids collection-time failures from Hexagon-specific runtime/session imports when running source-tree tests against a TVM wheel or an environment that does not need to execute Hexagon tests.