Avocado is a set of tools and libraries to help with automated testing. One can call it a test framework with benefits. Native tests are written in Python and they follow the unittest pattern, but any executable can serve as a test.
Describe the bug
Commit 58738b61a8bd6af542ff82a2ccccb49551c48c1b fixed an import time compatibility issue on avocado.utils.kernel with regards to either pkg_resources or packaging.
That in fact only masked some other problems:
The version module is not directly accessible in packaging
The behavior of version.parse() is different between the one coming from pkg_resources and from packaging.
Steps to reproduce
To reproduce 1, run:
python3 -c 'import packaging; packaging.version.parse("1.2.3")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'packaging' has no attribute 'version'
To reproduce 2, on a system with packaging, run:
$ python3 -c 'from packaging.version import parse; parse("6.11.4-201.fc40.x86_64")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.12/site-packages/packaging/version.py", line 54, in parse
return Version(version)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/packaging/version.py", line 200, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '6.11.4-201.fc40.x86_64'
Describe the bug Commit 58738b61a8bd6af542ff82a2ccccb49551c48c1b fixed an import time compatibility issue on
avocado.utils.kernel
with regards to eitherpkg_resources
orpackaging
.That in fact only masked some other problems:
version
module is not directly accessible inpackaging
version.parse()
is different between the one coming frompkg_resources
and frompackaging
.Steps to reproduce To reproduce 1, run:
To reproduce 2, on a system with
packaging
, run:While on a system with
pkg_resources
you'd get: