Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avocado.utils.kernel: fix kernel version parsing #6069

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

clebergnu
Copy link
Contributor

This fixes two problems with the current version parse mechanism:

  1. Recent setuptools' version parse function, which has dropped "LegacyVersion" support, raises an InvalidVersion exception for common kernel version info as presented by the system and returned by os.uname()

  2. The import of the packaging module is broken on systems with no setuptools and only the "packaging" module.

This introduces a simple but custom version parse that solves both and simplifies dependencies.

Fixes: #6058

This fixes two problems with the current version parse mechanism:

 1. Recent setuptools' version parse function, which has dropped
    "LegacyVersion" support, raises an InvalidVersion exception
    for common kernel version info as presented by the system and
    returned by os.uname()

 2. The import of the packaging module is broken on systems with no
    setuptools and only the "packaging" module.

This introduces a simple but custom version parse that solves both and
simplifies dependencies.

Fixes: avocado-framework#6058
Signed-off-by: Cleber Rosa <[email protected]>
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 54.47%. Comparing base (7420e5f) to head (f452aa5).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
avocado/utils/kernel.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6069      +/-   ##
==========================================
+ Coverage   54.44%   54.47%   +0.02%     
==========================================
  Files         202      202              
  Lines       21890    21892       +2     
==========================================
+ Hits        11918    11925       +7     
+ Misses       9972     9967       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

LGTM, thank you.

@richtja richtja merged commit 5b65f4f into avocado-framework:master Nov 25, 2024
60 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done 109
Development

Successfully merging this pull request may close these issues.

avocado.utils.kernel.check_version is broken with imports and actual check
2 participants