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

[BUG] entrypoint issue for dispatcher #91

Closed
goodwanghan opened this issue Sep 20, 2022 · 0 comments · Fixed by #93
Closed

[BUG] entrypoint issue for dispatcher #91

goodwanghan opened this issue Sep 20, 2022 · 0 comments · Fixed by #93

Comments

@goodwanghan
Copy link
Collaborator

goodwanghan commented Sep 20, 2022

This problem happens only when python>=3.10 and importlib-metadata is installed, plus some additional unknown conditions.

I am still unable to reproduce, but the error will look like:

.venv/lib/python3.10/site-packages/fugue/extensions/transformer/convert.py:177: in deco
    return _FuncAsTransformer.from_func(
.venv/lib/python3.10/site-packages/fugue/extensions/transformer/convert.py:296: in from_func
    tr._wrapper = FunctionWrapper(  # type: ignore
.venv/lib/python3.10/site-packages/fugue/_utils/interfaceless.py:163: in __init__
    self._class_method, self._params, self._rt = self._parse_function(
.venv/lib/python3.10/site-packages/fugue/_utils/interfaceless.py:246: in _parse_function
    res[k] = self._parse_param(anno, w)
.venv/lib/python3.10/site-packages/fugue/_utils/interfaceless.py:266: in _parse_param
    import fugue._utils.register  # pylint: disable=W0611 # noqa: F401
.venv/lib/python3.10/site-packages/fugue/_utils/register.py:17: in <module>
    register_plugins()
.venv/lib/python3.10/site-packages/fugue/_utils/register.py:8: in register_plugins
    for plugin in entry_points().get("fugue.plugins", []):
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/importlib/metadata/__init__.py:1009: in entry_points
    return SelectableGroups.load(eps).select(**params)
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/importlib/metadata/__init__.py:459: in load
    ordered = sorted(eps, key=by_group)
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/importlib/metadata/__init__.py:1006: in <genexpr>
    eps = itertools.chain.from_iterable(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

iterable = <itertools.chain object at 0x7f2b102c1ff0>
key = operator.attrgetter('_normalized_name')

    def unique_everseen(iterable, key=None):
        "List unique elements, preserving order. Remember all elements ever seen."
        # unique_everseen('AAAABBBCCDAABBB') --> A B C D
        # unique_everseen('ABBCcAD', str.lower) --> A B C D
        seen = set()
        seen_add = seen.add
        if key is None:
            for element in filterfalse(seen.__contains__, iterable):
                seen_add(element)
                yield element
        else:
            for element in iterable:
>               k = key(element)
E               AttributeError: 'PathDistribution' object has no attribute '_normalized_name'

/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/importlib/metadata/_itertools.py:16: AttributeError

This is a bug related to pypa/setuptools#3452
But there is a solution that may also solve this triad problem: pypa/virtualenv@bb82a73

@goodwanghan goodwanghan linked a pull request Oct 15, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant