Skip to content

Fix pkg_resources deprecation warning with importlib.metadata#68

Merged
nee1k merged 1 commit intomainfrom
fix/importlib-metadata-compatibility
Oct 26, 2025
Merged

Fix pkg_resources deprecation warning with importlib.metadata#68
nee1k merged 1 commit intomainfrom
fix/importlib-metadata-compatibility

Conversation

@nee1k
Copy link
Copy Markdown
Collaborator

@nee1k nee1k commented Oct 26, 2025

Problem

The package was showing deprecation warnings for on Python 3.8+ and failing to import on Python 3.12+ due to missing module.

Solution

  • Replace direct import with modern approach
  • Add backward compatibility for older Python versions using fallback logic
  • Update method to use
  • Maintain full functionality while eliminating deprecation warnings

Changes

  • Modified to use for Python 3.8+
  • Added fallback to for older Python versions
  • Updated method with compatibility logic

Testing

  • ✅ Verified import works without deprecation warnings
  • ✅ Confirmed works correctly
  • ✅ Maintains backward compatibility with older Python versions
  • ✅ Future-proof for when is removed

Benefits

  • Eliminates deprecation warnings on modern Python versions
  • Maintains compatibility with older Python versions
  • Future-proof implementation
  • No breaking changes to existing functionality

- Replace direct pkg_resources import with modern importlib.metadata approach
- Add backward compatibility for older Python versions
- Update populate_requirements() method to use importlib.metadata.distributions()
- Eliminates deprecation warnings on Python 3.8+ while maintaining compatibility
- Resolves: ModuleNotFoundError and UserWarning for pkg_resources
@nee1k nee1k merged commit cbca9bd into main Oct 26, 2025
2 checks passed
@nee1k nee1k deleted the fix/importlib-metadata-compatibility branch October 26, 2025 00:31
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.

1 participant