Skip to content

Replace pkg_resources with importlib.resources#27

Merged
samvelyan merged 2 commits intoNetHack-LE:mainfrom
codingWhale13:replace-pkg_resources
Jul 14, 2025
Merged

Replace pkg_resources with importlib.resources#27
samvelyan merged 2 commits intoNetHack-LE:mainfrom
codingWhale13:replace-pkg_resources

Conversation

@codingWhale13
Copy link

@codingWhale13 codingWhale13 commented Jun 18, 2025

This resolves "UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81".

Note: importlib.resources requires Python ≥3.7, same as MiniHack (see setup.py).

EDIT: It turns out that importlib.resources.files requires Python ≥3.9 so the next best thing is to use its backport importlib-resources, which adds an extra dependency.

This resolves "UserWarning: pkg_resources is deprecated as an API. See
https://setuptools.pypa.io/en/latest/pkg_resources.html. The
pkg_resources package is slated for removal as early as 2025-11-30.
Refrain from using this package or pin to Setuptools<81."
Reason: importlib.resources.files is only available in Python>=3.9
@codingWhale13 codingWhale13 force-pushed the replace-pkg_resources branch from a9cb582 to 2d4945a Compare June 18, 2025 12:04
@samvelyan
Copy link
Collaborator

Thank @codingWhale13 for the PR.

@samvelyan samvelyan merged commit 95b11cc into NetHack-LE:main Jul 14, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants