Skip to content

Drop runtime pkg_resources dependency for setuptools >= 82 compatibility#4

Merged
pmrv merged 1 commit into
masterfrom
claude/setuptools-dep-update-2bary2
Jul 16, 2026
Merged

Drop runtime pkg_resources dependency for setuptools >= 82 compatibility#4
pmrv merged 1 commit into
masterfrom
claude/setuptools-dep-update-2bary2

Conversation

@pmrv

@pmrv pmrv commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Pull Request Template

Description of Changes

setuptools 82 removed the pkg_resources module entirely (it was deprecated in 81), which broke this package at runtime: bin/pacemaker and src/pyace/multispecies_basisextension.py failed at import time with ModuleNotFoundError: No module named 'pkg_resources' when installed alongside setuptools > 81.

  • Replaced pkg_resources.resource_filename(...) with importlib.resources.files(...) in bin/pacemaker and src/pyace/multispecies_basisextension.py, with a pkg_resources fallback for Python 3.8 (the oldest supported version, where importlib.resources.files is unavailable). This removes the implicit runtime dependency on setuptools altogether.
  • Removed the unused from distutils.version import LooseVersion import in setup.py (distutils was removed from the stdlib in Python 3.12).

Verified in a clean venv with setuptools 83.0.0 (no pkg_resources module present): the importlib.resources lookup resolves pyace.data resource paths correctly, and setup.py egg_info still succeeds.

Checklist

  • Code is well-documented.
  • All tests have been run and passed.
  • Relevant documentation has been updated if necessary.

License Agreement

By submitting this pull request, I agree that:

  • The code submitted in this pull request will be distributed under the Academic Software License (free for academic non-commercial use, not free for commercial use), see LICENSE.md for more details.
  • The copyright for the code, including the submitted code, remains with Ruhr University Bochum. Ruhr University Bochum retains the right to transfer or modify the copyright.

🤖 Generated with Claude Code

https://claude.ai/code/session_013rATYdnCXiGYC3bkbirURw


Generated by Claude Code

setuptools 82 removed the pkg_resources module entirely, which broke
'pacemaker' and pyace.multispecies_basisextension at import time
(ModuleNotFoundError: No module named 'pkg_resources').

Replace pkg_resources.resource_filename with importlib.resources.files,
keeping a pkg_resources fallback for Python 3.8 where
importlib.resources.files is unavailable. Also drop the unused
distutils.version.LooseVersion import from setup.py (distutils was
removed from the stdlib in Python 3.12).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rATYdnCXiGYC3bkbirURw

@pmrv pmrv left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm merge

@pmrv
pmrv merged commit 8ef0081 into master Jul 16, 2026
2 of 3 checks passed
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