Skip to content

fix: replace deprecated pkg_resources with importlib.metadata (#1816)#1819

Open
prodduturisindhurdy wants to merge 1 commit intoData-Centric-AI-Community:developfrom
prodduturisindhurdy:fix/replace-pkg-resources-1816
Open

fix: replace deprecated pkg_resources with importlib.metadata (#1816)#1819
prodduturisindhurdy wants to merge 1 commit intoData-Centric-AI-Community:developfrom
prodduturisindhurdy:fix/replace-pkg-resources-1816

Conversation

@prodduturisindhurdy
Copy link
Copy Markdown

Problem

profile_report.py imports pkg_resources directly, which was removed
in setuptools>=81. This causes ModuleNotFoundError on fresh environments
with modern setuptools.

Fix

Replaced pkg_resources.get_distribution("Pillow").version with
importlib.metadata.version("Pillow"), available since Python 3.8.
The utils/versions.py file already uses this pattern — this PR
makes profile_report.py consistent with it.

Testing

  • Verified import works on Python 3.13 with setuptools>=81
  • No existing tests broken

Closes #1816

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.

Replace deprecated pkg_resources with importlib.metadata in profile_report.p

1 participant