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

Release 0.2.0 bug: get project name from entree point #292

Closed
woutdenolf opened this issue Dec 15, 2023 · 7 comments
Closed

Release 0.2.0 bug: get project name from entree point #292

woutdenolf opened this issue Dec 15, 2023 · 7 comments

Comments

@woutdenolf
Copy link

2023-12-15 13:45:42,261:ERROR:orangecanvas.registry.discovery: An exception occurred while processing EntryPoint.parse('Ewoks Demo = orangecontrib.ewoksdemo').
Traceback (most recent call last):
  File "/home/denolf/ewokstest/lib/python3.8/site-packages/orangecanvas/registry/discovery.py", line 141, in run
    self.process_category_package(
  File "/home/denolf/ewokstest/lib/python3.8/site-packages/orangecanvas/registry/discovery.py", line 213, in process_category_package
    cat_desc.project_name = distribution.name
  File "/home/denolf/ewokstest/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2900, in __getattr__
    return getattr(self._provider, attr)
AttributeError: 'PathMetadata' object has no attribute 'name'
``

It seems that the correct attribute is not 'name' but 'project_name' (I tried python 3.9 and 3.11).
@woutdenolf
Copy link
Author

woutdenolf commented Dec 15, 2023

Seems like there are several places where this can occur:

cat_desc.project_name = distribution.name

desc.project_name = distribution.name

project_name = distribution.name

if entry.project_name != distribution.name or \

@woutdenolf woutdenolf changed the title Release 0.2.0 bug: get project name from Release 0.2.0 bug: get project name from entree point Dec 15, 2023
@woutdenolf
Copy link
Author

woutdenolf commented Dec 15, 2023

The distribution variable seems to be of type pkg_resources.DistInfoDistribution which does not have a name attribute.

@woutdenolf
Copy link
Author

@woutdenolf
Copy link
Author

woutdenolf commented Dec 15, 2023

When running the tests of this project the distribution variable type is importlib.metadata.PathDistribution which does have a name attribute.

However when getting the distribution from an entry point (not covered by the unit test but happens in reality) you get distribution variable type pkg_resources.DistInfoDistribution which does not have a name attribute (called project_name instead).

@woutdenolf
Copy link
Author

woutdenolf commented Dec 15, 2023

@markotoplak
Copy link
Member

@woutdenolf, yes, orange-canvas-core 0.2.0 is indeed also incompatible with the current master of Orange (which depended on orange-canvas-core<0.2 for a long time now.

@markotoplak
Copy link
Member

See biolab/orange3#6655 for more info.

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

No branches or pull requests

2 participants