@@ -159,8 +159,7 @@ Legacy namespace packages
159159
160160These two methods, that were used to create namespace packages prior to :pep: `420 `,
161161are now considered to be obsolete and should not be used unless you need compatibility
162- with packages already using this method. Also, :doc: `pkg_resources <setuptools:pkg_resources >`
163- has been deprecated.
162+ with packages already using one of these methods.
164163
165164To migrate an existing package, all packages sharing the namespace must be migrated simultaneously.
166165
@@ -176,7 +175,7 @@ pkgutil-style namespace packages
176175Python 2.3 introduced the :doc: `pkgutil <python:library/pkgutil >` module and the
177176:py:func: `python:pkgutil.extend_path ` function. This can be used to declare namespace
178177packages that need to be compatible with both Python 2.3+ and Python 3. This
179- is the recommended approach for the highest level of compatibility.
178+ was the recommended approach for the highest level of compatibility.
180179
181180To create a pkgutil-style namespace package, you need to provide an
182181:file: `__init__.py ` file for the namespace package:
@@ -216,10 +215,18 @@ in the `pkgutil namespace example project`_.
216215pkg_resources-style namespace packages
217216^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
218217
219- :doc: `Setuptools <setuptools:index >` provides the `pkg_resources.declare_namespace `_ function and
218+ .. warning ::
219+
220+ The information in this section is obsolete and is no longer functional
221+ (as of Setuptools 82.0.0). It is only retained for historical reference.
222+
223+ ``pkg_resources `` has been deprecated and was fully removed in Setuptools 82.0.0.
224+
225+ :doc: `Setuptools <setuptools:index >` previously provided the ``pkg_resources.declare_namespace `` function and
220226the ``namespace_packages `` argument to :func: `~setuptools.setup `. Together
221- these can be used to declare namespace packages. While this approach is no
222- longer recommended, it is widely present in most existing namespace packages.
227+ these could be used to declare namespace packages. While this approach is no
228+ longer supported, it may still be encountered in environments using older
229+ ``setuptools `` versions.
223230If you are creating a new distribution within an existing namespace package that
224231uses this method then it's recommended to continue using this as the different
225232methods are not cross-compatible and it's not advisable to try to migrate an
@@ -281,11 +288,3 @@ to :func:`~setuptools.setup` in :file:`setup.py`. For example:
281288 packages = find_packages()
282289 namespace_packages = [' mynamespace' ]
283290 )
284-
285- A complete working example of two pkg_resources-style namespace packages can be found
286- in the `pkg_resources namespace example project `_.
287-
288- .. _pkg_resources.declare_namespace :
289- https://setuptools.readthedocs.io/en/latest/pkg_resources.html#namespace-package-support
290- .. _pkg_resources namespace example project :
291- https://github.com/pypa/sample-namespace-packages/tree/master/pkg_resources
0 commit comments