Skip to content

fix: replace pkg_resources with importlib.resources for Python 3.14 compat#242

Merged
kusold merged 2 commits intomainfrom
fix/replace-pkg-resources-with-importlib
Apr 7, 2026
Merged

fix: replace pkg_resources with importlib.resources for Python 3.14 compat#242
kusold merged 2 commits intomainfrom
fix/replace-pkg-resources-with-importlib

Conversation

@kusold
Copy link
Copy Markdown
Owner

@kusold kusold commented Apr 7, 2026

Summary

  • Replace pkg_resources with importlib.resources in shreddit/app.py, fixing ModuleNotFoundError: No module named 'pkg_resources' on Python 3.14
  • Remove setuptools from dependencies since it's no longer needed
  • Bump version to 6.4.2

Context

The Docker image (python:3.14-alpine) doesn't include setuptools by default, and pkg_resources was removed from the stdlib in Python 3.14. This caused shreddit to crash on every invocation.

Test plan

  • Verify docker build . succeeds
  • Verify shreddit -g generates config files correctly
  • Verify normal shreddit invocation works against Reddit API

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

❌ Commit Message Validation Failed

Some commits in this PR don't follow the Conventional Commits specification.

Format Required

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Examples

  • feat: add automated security scanning
  • fix: resolve Docker build issue
  • docs: update installation guide
  • chore: update dependencies
  • refactor(api): simplify error handling

Allowed Types

See commitlint.config.js for the complete list of allowed types and validation rules.

Common types include:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that don't affect code meaning (formatting, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Performance improvement
  • test: Adding or correcting tests
  • build: Changes to build system or dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

How to Fix

You can either:

  1. Amend your commit messages using git rebase -i and force push
  2. Squash commits when merging (ensure the PR title follows the format)

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.
@kusold kusold force-pushed the fix/replace-pkg-resources-with-importlib branch from f3db069 to 1e99da2 Compare April 7, 2026 20:48
@kusold kusold changed the title Replace pkg_resources with importlib.resources for Python 3.14 compat fix: replace pkg_resources with importlib.resources for Python 3.14 compat Apr 7, 2026
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.
@kusold kusold merged commit c55316c into main Apr 7, 2026
10 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

🎉 This PR is included in version 6.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant