Skip to content

[Tests][Hexagon] Lazily import pytest plugin dependencies#19726

Merged
tqchen merged 1 commit into
apache:mainfrom
tlopex:fix-hexagon-wheel-collection
Jun 11, 2026
Merged

[Tests][Hexagon] Lazily import pytest plugin dependencies#19726
tqchen merged 1 commit into
apache:mainfrom
tlopex:fix-hexagon-wheel-collection

Conversation

@tlopex

@tlopex tlopex commented Jun 10, 2026

Copy link
Copy Markdown
Member

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread python/tvm/contrib/hexagon/pytest_plugin.py
Comment thread python/tvm/contrib/hexagon/pytest_plugin.py
@tlopex tlopex force-pushed the fix-hexagon-wheel-collection branch from 87a8bf1 to 4ff6e51 Compare June 10, 2026 21:34
@tlopex tlopex force-pushed the fix-hexagon-wheel-collection branch from 4ff6e51 to a15c67c Compare June 10, 2026 21:38
@tqchen tqchen merged commit e41454d into apache:main Jun 11, 2026
9 checks passed
MasterJH5574 pushed a commit to MasterJH5574/tvm that referenced this pull request Jun 15, 2026
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)
MasterJH5574 pushed a commit to MasterJH5574/tvm that referenced this pull request Jun 15, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants