Skip to content

Commit 8f7c8ff

Browse files
committed
Mention packaging on pkg_resources deprecation notes (#3949)
2 parents 63a4f85 + 5e84450 commit 8f7c8ff

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

docs/pkg_resources.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ packages.
1414
Use of ``pkg_resources`` is deprecated in favor of
1515
:mod:`importlib.resources`, :mod:`importlib.metadata`
1616
and their backports (:pypi:`importlib_resources`, :pypi:`importlib_metadata`).
17+
Some useful APIs are also provided by :pypi:`packaging` (e.g. requirements
18+
and version parsing).
1719
Users should refrain from new usage of ``pkg_resources`` and
1820
should work to port to importlib-based solutions.
1921

pkg_resources/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
.zip files and with custom PEP 302 loaders that support the ``get_data()``
1414
method.
1515
16-
This module is deprecated. Users are directed to
17-
`importlib.resources <https://docs.python.org/3/library/importlib.resources.html>`_
18-
and
19-
`importlib.metadata <https://docs.python.org/3/library/importlib.metadata.html>`_
20-
instead.
16+
This module is deprecated. Users are directed to :mod:`importlib.resources`,
17+
:mod:`importlib.metadata` and :pypi:`packaging` instead.
2118
"""
2219

2320
import sys
@@ -118,9 +115,12 @@
118115
_namespace_packages = None
119116

120117

121-
warnings.warn("pkg_resources is deprecated as an API. "
122-
"See https://setuptools.pypa.io/en/latest/pkg_resources.html",
123-
DeprecationWarning, stacklevel=2)
118+
warnings.warn(
119+
"pkg_resources is deprecated as an API. "
120+
"See https://setuptools.pypa.io/en/latest/pkg_resources.html",
121+
DeprecationWarning,
122+
stacklevel=2
123+
)
124124

125125

126126
_PEP440_FALLBACK = re.compile(r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.I)

0 commit comments

Comments
 (0)