Skip to content

fix: replace pkg_resources in system parameter logging - #3417

Open
mohamed-chaaben wants to merge 1 commit into
aimhubio:mainfrom
mohamed-chaaben:fix/replace-pkg-resources
Open

fix: replace pkg_resources in system parameter logging#3417
mohamed-chaaben wants to merge 1 commit into
aimhubio:mainfrom
mohamed-chaaben:fix/replace-pkg-resources

Conversation

@mohamed-chaaben

Copy link
Copy Markdown

Summary

  • replace pkg_resources.working_set with importlib.metadata
  • use the importlib-metadata backport on Python 3.7
  • preserve the previous normalized package-key format
  • cache installed-package discovery and return independent copies
  • add regression coverage for incomplete metadata and cached results

Motivation

get_installed_packages() is used when log_system_params=True. Its current use of the deprecated pkg_resources module can fail when that module is not available.

Testing

  • ruff check aim/ext/utils.py setup.py tests/ext/test_utils.py
  • ruff format aim/ext/utils.py setup.py tests/ext/test_utils.py --check
  • pytest tests/ext/test_utils.py tests/sdk/test_run_creation_checks.py -v

Result: 3 tests passed. The reported SQLAlchemy warnings are pre-existing and unrelated to this change.

Collect installed package versions with importlib.metadata and use the importlib-metadata backport on Python 3.7.

Preserve legacy package-name normalization, cache the distribution scan, and return copies so callers cannot modify cached data. Add regression coverage.
@CLAassistant

CLAassistant commented Aug 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants