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
Due to a slight misunderstanding of the new importlib.metadata API, AiiDA did no longer raise when detecting multiple entries for a given entry point (pair of group + name), and instead simply loaded the first one.
Will open PR to fix
The text was updated successfully, but these errors were encountered:
While our code clearly intends to do this check (and probably was doing it before we switched to the new importlib.metadata API), I now notice that reintroducing it creates problems e.g. in the AiiDAlab environment, where users may want to e.g. install a newer AiiDA version over the one that is shipped with the image (and which they can't remove).
E.g. after installing a separate AiiDA version in the user's local environment in the AiiDAlab docker image (my AiiDA 2.0 version), opening the verdi shell gives me
ValueError: aiida.groups:core is not a valid entry point string: Multiple entry points 'core' found in group 'aiida.groups': [EntryPoint(name='core', value='aiida.orm.groups:Group', group='aiida.groups'), EntryPoint(name='core', value='aiida.orm.groups:Group', group='aiida.groups')]
I'm a little surprised that this did not surface before... it's true that we started using entry points in more places in aiida-core recently, but we were using them also before.
In my view it needs to be possible to install AiiDA over an existing installation.
One thing we could do is: if multiple entries are discovered, check whether their values (target strings) are the same.
If they are, then it actually does not matter which one we load and we can proceed.
If their values differ, we don't know what to do and raise.
Are you sure you are not misunderstanding the difference between importlib.metadata and importlib_metadata, the latter of which implements the new python 3.10 API
Are you sure you are not misunderstanding the difference between importlib.metadata and importlib_metadata, the latter of which implements the new python 3.10 API
What would make you think that?
Have you looked at the code example in the PR?
Describe the bug
Due to a slight misunderstanding of the new
importlib.metadata
API, AiiDA did no longer raise when detecting multiple entries for a given entry point (pair of group + name), and instead simply loaded the first one.Will open PR to fix
The text was updated successfully, but these errors were encountered: