Skip to content

Comments

Remove dead link to pkg_resources#2002

Open
woodruffw wants to merge 2 commits intomainfrom
ww/fix
Open

Remove dead link to pkg_resources#2002
woodruffw wants to merge 2 commits intomainfrom
ww/fix

Conversation

@woodruffw
Copy link
Member

@woodruffw woodruffw commented Feb 10, 2026

pkg_resources is no longer provided by setuptools, so this link is dead (and breaks the build). I've removed the link but kept the term itself, along with a mention of the removal.

Ref: https://discuss.python.org/t/pkg-resources-removal-how-to-go-from-there/106079


📚 Documentation preview 📚: https://python-packaging-user-guide--2002.org.readthedocs.build/en/2002/

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw self-assigned this Feb 10, 2026
@woodruffw
Copy link
Member Author

CC @pypa/packaging-user-guide-editors

@woodruffw woodruffw requested a review from a team February 10, 2026 17:30
@edgarrmondragon
Copy link
Contributor

It's linked to in other places unfortunately:

Refer to the `pkg_resources documentation
<https://setuptools.readthedocs.io/en/latest/pkg_resources.html#workingset-objects>`__
for more details.

.. _pkg_resources.declare_namespace:
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#namespace-package-support

@woodruffw
Copy link
Member Author

It's linked to in other places unfortunately:

Grumble, thanks 🙂

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw enabled auto-merge February 15, 2026 16:36
Copy link
Member

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "request changes" is because pkgutil based namespace packages have nothing to do with pkg_resources, so the legacy namespace package warning is misplaced.

The other suggestions are because I think we should salt this earth more thoroughly :)

.. warning::

The information in this section is obsolete and is no longer functional
(as of Setuptools 82.0.0). It is only retained for historical reference.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This warning is misplaced - it should be down in the pkg_resources subsection.

pkgutil based legacy namespace packages have no connection to setuptools, they rely solely on the standard library (and we don't have any plans to break them that I'm aware of).

:doc:`Setuptools <setuptools:index>` provides the `pkg_resources.declare_namespace`_ function and
:doc:`Setuptools <setuptools:index>` previously provided the ``pkg_resources.declare_namespace`` function and
the ``namespace_packages`` argument to :func:`~setuptools.setup`. Together
these can be used to declare namespace packages. While this approach is no
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
these can be used to declare namespace packages. While this approach is no
these could be used to declare namespace packages. While this approach is no

:doc:`Setuptools <setuptools:index>` previously provided the ``pkg_resources.declare_namespace`` function and
the ``namespace_packages`` argument to :func:`~setuptools.setup`. Together
these can be used to declare namespace packages. While this approach is no
longer recommended, it is widely present in most existing namespace packages.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
longer recommended, it is widely present in most existing namespace packages.
longer supported, it may still be encountered in environments using older `setuptools` versions.

Comment on lines 291 to 293
A complete working example of two pkg_resources-style namespace packages can be found
in the `pkg_resources namespace example project`_.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A complete working example of two pkg_resources-style namespace packages can be found
in the `pkg_resources namespace example project`_.

We shouldn't link to an example that no longer works.

Comment on lines 294 to 295
.. _pkg_resources namespace example project:
https://github.com/pypa/sample-namespace-packages/tree/master/pkg_resources
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. _pkg_resources namespace example project:
https://github.com/pypa/sample-namespace-packages/tree/master/pkg_resources

are now considered to be obsolete and should not be used unless you need compatibility
with packages already using this method. Also, :doc:`pkg_resources <setuptools:pkg_resources>`
has been deprecated.
with packages already using this method.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with packages already using this method.
with packages already using one of these methods.

Comment on lines 184 to 185
packages that need to be compatible with both Python 2.3+ and Python 3. This
is the recommended approach for the highest level of compatibility.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
packages that are compatible with both Python 2.3+ and Python 3. This was the
recommended approach for the highest level of compatibility when Python 2.7
was still supported, but native namespace packages (available since Python 3.3)
are now the preferred approach.

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.

5 participants