-
Notifications
You must be signed in to change notification settings - Fork 575
Closed
Description
As of setuptools==80.9.0
, when importing napalm
, the following warning is shown about pkg_resources
being deprecated and slated for removal in December:
Python 3.12.10 (main, Apr 9 2025, 03:49:38) [Clang 20.1.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import napalm
/Users/me/dir/.venv/lib/python3.12/site-packages/napalm/__init__.py:1: 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.
import pkg_resources
The referenced setuptools
link includes more details (emphasis mine):
Use of
pkg_resources
is deprecated in favor ofimportlib.resources
,importlib.metadata
and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage ofpkg_resources
and should work to port to importlib-based solutions.
setuptools
issue #3085 and draft PR #5007 have some additional discussion.
In our project we have pinned setuptools<80.9.0
to avoid the warning for now.
Nativu5
Metadata
Metadata
Assignees
Labels
No labels