fix: replace pkg_resources with importlib.resources for Python 3.14 compat#242
Merged
fix: replace pkg_resources with importlib.resources for Python 3.14 compat#242
Conversation
❌ Commit Message Validation FailedSome commits in this PR don't follow the Conventional Commits specification. Format RequiredExamples
Allowed TypesSee Common types include:
How to FixYou can either:
Note: The PR title must also follow this format as it will be used for the merge commit. |
…ompat pkg_resources was removed from the stdlib in Python 3.14, causing shreddit to fail immediately with ModuleNotFoundError. Replace with importlib.resources which has been available since Python 3.9.
f3db069 to
1e99da2
Compare
Add a test that imports shreddit.app to catch missing module-level dependencies at import time (e.g. pkg_resources on Python 3.14+). Also tests the -g config generation flag.
|
🎉 This PR is included in version 6.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg_resourceswithimportlib.resourcesinshreddit/app.py, fixingModuleNotFoundError: No module named 'pkg_resources'on Python 3.14setuptoolsfrom dependencies since it's no longer neededContext
The Docker image (
python:3.14-alpine) doesn't includesetuptoolsby default, andpkg_resourceswas removed from the stdlib in Python 3.14. This caused shreddit to crash on every invocation.Test plan
docker build .succeedsshreddit -ggenerates config files correctly