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

[ENH] Remove use of pkg_resources #260

Merged
merged 8 commits into from
Dec 14, 2023

Conversation

ales-erjavec
Copy link
Collaborator

@ales-erjavec ales-erjavec commented Nov 16, 2023

Issue

pkg_resources is deprecated.

Requires biolab/orange-canvas-core#289

Description of changes

Remove/replace use of pkg_resources with importlib.metadata, importlib.resources, pkgutil and packaging.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov-commenter
Copy link

codecov-commenter commented Nov 16, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (cc4feec) 71.65% compared to head (9b5ed7b) 71.72%.

Files Patch % Lines
orangewidget/workflow/errorreporting.py 0.00% 3 Missing ⚠️
orangewidget/workflow/config.py 33.33% 2 Missing ⚠️
orangewidget/workflow/discovery.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
+ Coverage   71.65%   71.72%   +0.07%     
==========================================
  Files          34       34              
  Lines        9091     9086       -5     
==========================================
+ Hits         6514     6517       +3     
+ Misses       2577     2569       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ales-erjavec ales-erjavec force-pushed the remove-pkg-resources branch 2 times, most recently from 745fa71 to 7ba5471 Compare November 17, 2023 14:06
@ales-erjavec ales-erjavec marked this pull request as ready for review December 8, 2023 09:54
@PrimozGodec
Copy link
Contributor

After I check out this PR, and run orange-canvas --force-discovery, I get the following error:

Traceback (most recent call last):
  File "/Users/primoz/python-projects/orange-canvas-core/orangecanvas/registry/discovery.py", line 231, in process_loader
    callable(self)
  File "/Users/primoz/python-projects/orange3/Orange/widgets/__init__.py", line 45, in widget_discovery
    discovery.process_category_package(pkg, distribution=dist)
  File "/Users/primoz/python-projects/orange-canvas-core/orangecanvas/registry/discovery.py", line 213, in process_category_package
    cat_desc.project_name = distribution.name
  File "/Users/primoz/miniconda3/envs/orange3/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2903, in __getattr__
    return getattr(self._provider, attr)
AttributeError: 'PathMetadata' object has no attribute 'name'

Am I doing anything wrong? I also have checked out the newest master version from orange-canvas-core.

@ales-erjavec
Copy link
Collaborator Author

Are you using/testing with biolab/orange3#6655 ?

@PrimozGodec PrimozGodec merged commit ea24f52 into biolab:master Dec 14, 2023
22 checks passed
@PrimozGodec
Copy link
Contributor

Thanks, @ales-erjavec it works with biolab/orange3#6655

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 this pull request may close these issues.

3 participants