Skip to content

replace pkg_resource with importlib{_,.}{metadata,resources}#945

Open
kba wants to merge 3 commits into
IDSIA:masterfrom
kba:pkg_resources-to-importlib
Open

replace pkg_resource with importlib{_,.}{metadata,resources}#945
kba wants to merge 3 commits into
IDSIA:masterfrom
kba:pkg_resources-to-importlib

Conversation

@kba
Copy link
Copy Markdown

@kba kba commented May 7, 2026

setuptools 82 has finally removed pkg_resources outright, so the pkg_resources calls and runtime setuptools dependency needs to go now.

This PR:

Workaround if this PR needs more time is to pin setuptools < 82 in requirements.txt.

@thequilo
Copy link
Copy Markdown
Collaborator

thequilo commented May 8, 2026

I'm all for removing pkg_resources if it doesn't break on old (but still supported) Python versions, which it currently does (see tests). I'm also fine with removing Python 3.8 from the tests and adding python versions up to 3.14 to the tests.

@kba
Copy link
Copy Markdown
Author

kba commented May 11, 2026

I'm all for removing pkg_resources if it doesn't break on old (but still supported) Python versions, which it currently does (see tests). I'm also fine with removing Python 3.8 from the tests and adding python versions up to 3.14 to the tests.

I have changed the version switches, so the importlib_metadata is used instead of importlib.metadata for Python 3.10 and older did not have the importlib.metadata.package_distributions method.

I have not changed the versions tested because I don't fully understand how this tox workflow works. I would appreciate retaining support for 3.8 while that is possible without breaking compatibility with newer versions because we have some setups for training that still use it.

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