Skip to content

Replace pkg_resources with importlib.resources - #1261

Open
daeho-ro wants to merge 1 commit into
tern-tools:mainfrom
daeho-ro:importlib-resources
Open

Replace pkg_resources with importlib.resources#1261
daeho-ro wants to merge 1 commit into
tern-tools:mainfrom
daeho-ro:importlib-resources

Conversation

@daeho-ro

@daeho-ro daeho-ro commented Aug 9, 2026

Copy link
Copy Markdown

setuptools removed pkg_resources in 81.0.0, so tern fails to import on any environment with a current setuptools:

ModuleNotFoundError: No module named 'pkg_resources'

Older setuptools already warns about it:

UserWarning: pkg_resources is deprecated as an API ... The pkg_resources
package is slated for removal as early as 2025-11-30.

All four call sites only resolve a path to a file shipped inside the package, which importlib.resources.files() does since Python 3.9, so no dependency on setuptools is needed at runtime any more.

setuptools removed pkg_resources in 81.0.0, so tern fails to import on any
environment with a current setuptools:

  ModuleNotFoundError: No module named 'pkg_resources'

Older setuptools already warns about it:

  UserWarning: pkg_resources is deprecated as an API ... The pkg_resources
  package is slated for removal as early as 2025-11-30.

All four call sites only resolve a path to a file shipped inside the package,
which importlib.resources.files() does since Python 3.9, so no dependency on
setuptools is needed at runtime any more.
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.

1 participant