You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This shows up while trying to run the numpy test suite with python 3.11 and the newest pytest etc.
==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
[...]
=========================== short test summary info ============================
ERROR - AttributeError: 'PathDistribution' object has no attribute '_normalized_name'
ERROR - AttributeError: 'PathDistribution' object has no attribute '_normalized_name'
2 errors in 1.41s
More precisely, the error appears in the vendored import_lib module
[...]/lib/python3.11/importlib/metadata/__init__.py:472: in load
ordered = sorted(eps, key=by_group)
by_group = operator.attrgetter('group')
cls = <class 'importlib.metadata.SelectableGroups'>
eps = <itertools.chain object at 0x7f19804ea5f0>
[...]/lib/python3.11/importlib/metadata/__init__.py:1013: in <genexpr>
eps = itertools.chain.from_iterable(
.0 = <generator object unique_everseen at 0x7f19805e9d40>
[...]/lib/python3.11/importlib/metadata/_itertools.py:16: in unique_everseen
k = key(element)
E AttributeError: 'PathDistribution' object has no attribute '_normalized_name'
element = <importlib_metadata.PathDistribution object at 0x7f19802c0450>
iterable = <itertools.chain object at 0x7f19804eae00>
key = operator.attrgetter('_normalized_name')
seen = set()
seen_add = <built-in method add of set object at 0x7f198035b060>
It looks like applying python/importlib_metadata@3e52430 should do the trick. Because #97785 is already in main, the changes will need to be applied to the 3.11 branch directly.
I note that 4.12.0 also includes changes that I'd previously not backported to Python 3.11 (#94270). @pablogsal Are you okay with changes from importlib_metadata 4.11.4-4.13.0 being applied as a bugfix for Python 3.11?
This shows up while trying to run the numpy test suite with python 3.11 and the newest pytest etc.
More precisely, the error appears in the vendored import_lib module
Turns out this is python/importlib_metadata#396 (fixed in 4.13.0), where @jaraco noted:
Unfortunately, the vendored version present in python 3.11 is only at 4.11.3, hence does not carry the fix.
The text was updated successfully, but these errors were encountered: