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

Usage of external dependency "packaging" in avocado/utils/kernel.py #5988

Closed
clebergnu opened this issue Jul 31, 2024 · 1 comment · Fixed by #5999
Closed

Usage of external dependency "packaging" in avocado/utils/kernel.py #5988

clebergnu opened this issue Jul 31, 2024 · 1 comment · Fixed by #5999
Assignees
Labels

Comments

@clebergnu
Copy link
Contributor

Describe the bug
The packaging module, while a suggested replacement for pkg_resources in Python 3.12, is not a standard library module, but an external one.

If setuptools<70.0 is present, the "packaging" package needs to be installed. If, setuptools>=70 is installed, it probably contains packaging as a "vendor" submodule.

This means that currently, installations of Avocado on systems with setuptools <70.0, need another external library (packaging) or will not be able to use avocado.utils.kernel.

Steps to reproduce
On a Fedora 40 system:

$ dnf install python3-pip python3-setuptools
$ python3 -m pip install avocado-framework==106.0
$ python3 -c 'import avocado.utils.kernel'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.12/site-packages/avocado/utils/kernel.py", line 26, in <module>
    from packaging.version import parse
ModuleNotFoundError: No module named 'packaging'

Expected behavior
A successful import of avocado.utils.kernel

Current behavior
A failure to import it:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.12/site-packages/avocado/utils/kernel.py", line 26, in <module>
    from packaging.version import parse
ModuleNotFoundError: No module named 'packaging'

System information (please complete the following information):

  • OS: LSB Version: :core-5.0-amd64:core-5.0-noarch:cxx-5.0-amd64:cxx-5.0-noarch:desktop-5.0-amd64:desktop-5.0-noarch:languages-5.0-amd64:languages-5.0-noarch:printing-5.0-amd64:printing-5.0-noarch Distributor ID: Fedora Description: Fedora release 40 (Forty) Release: 40 Codename: Forty
  • Avocado version: 106.0
  • Avocado installation method: pip
@clebergnu clebergnu added the bug label Jul 31, 2024
@richtja
Copy link
Contributor

richtja commented Jul 31, 2024

This was probably caused by changes in #5942

@richtja richtja self-assigned this Aug 12, 2024
richtja added a commit to richtja/avocado that referenced this issue Aug 12, 2024
This is a fix of kerne utils compatibility issue with setuptools=>70
which has been introduced in df6b1da.

Reference: avocado-framework#5988
Signed-off-by: Jan Richter <[email protected]>
@richtja richtja linked a pull request Aug 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done 107
Development

Successfully merging a pull request may close this issue.

2 participants