Skip to content

fix(pylint): add aexpect to pylint hook's additional_dependencies - #17

Open
misanjumn wants to merge 1 commit into
avocado-framework:mainfrom
misanjumn:pre-commit-vt
Open

misanjumn wants to merge 1 commit into
avocado-framework:mainfrom
misanjumn:pre-commit-vt

Conversation

@misanjumn

Copy link
Copy Markdown

fix(pylint): add aexpect to pylint hook's additional_dependencies

aexpect is a declared runtime dependency of avocado-vt (>=1.6.4) but was not installed in the pre-commit pylint hook's isolated environment. This caused E0401 (import-error) for any virttest file that imports aexpect, since pylint could not resolve the module during static analysis.

Add aexpect>=1.6.4 to additional_dependencies so the hook environment mirrors the declared runtime requirements.

Signed-off-by: Misbah Anjum N misanjum@linux.ibm.com

aexpect is a declared runtime dependency of avocado-vt (>=1.6.4) but
was not installed in the pre-commit pylint hook's isolated environment.
This caused E0401 (import-error) for any virttest file that imports
aexpect, since pylint could not resolve the module during static
analysis.

Add aexpect>=1.6.4 to additional_dependencies so the hook environment
mirrors the declared runtime requirements.

Signed-off-by: Misbah Anjum N <misanjumn@ibm.com>
@mr-avocado mr-avocado Bot moved this to Review Requested in Default project Sep 29, 2026
@misanjumn

Copy link
Copy Markdown
Author

Problem

The pre-commit pylint hook runs in an isolated Python environment (created by pre-commit from additional_dependencies). aexpect was not listed there, so pylint could not resolve import aexpect during static analysis, raising:

E0401: Unable to import 'aexpect' (import-error)

This surfaced in avocado-framework/avocado-vt#4378, which introduces virttest/utils_kdump.py, the first file in virttest/ that both imports aexpect and is fully checked by pylint (other files that import aexpect, such as virt_vm.py and utils_disk.py, are in the pylint ignore list).

Fix

Add aexpect>=1.6.4 to the pylint hook's additional_dependencies. The version constraint mirrors avocado-vt's own declared runtime dependency in requirements.txt.

Impact

Any current or future virttest file that imports aexpect will now be correctly resolved by pylint without needing to be added to the ignore list as a workaround.

Reference

avocado-framework/avocado-vt#4378 (the PR that exposed this issue)

@pevogam

pevogam commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@misanjumn Do you think you will be able to assist us with re-enabling other files once we merge this? I believe we have a multitude of such files desabled for this exact reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review Requested

Development

Successfully merging this pull request may close these issues.

2 participants