Skip to content

Conversation

@abravalheri
Copy link
Contributor

@abravalheri abravalheri commented Feb 9, 2026

Summary of changes

Closes #3085 (comment)

Pull Request Checklist

@abravalheri abravalheri marked this pull request as ready for review February 9, 2026 14:06
@abravalheri abravalheri changed the title Move pkg_resources docs away from the main documents. Move pkg_resources docs away from the main documents and signal it is no longer supported. Feb 9, 2026
@Avasam
Copy link
Contributor

Avasam commented Feb 9, 2026

You can ignore the mypy issue. It should be fixed by jaraco/jaraco.text#28

@Avasam
Copy link
Contributor

Avasam commented Feb 9, 2026

Here's additional non-deprecated, non-historical documentations that assume a still active pkg_resources:

https://github.com/pypa/setuptools/blob/main/docs/setuptools.rst#transitional-note

such as needing to import all namespace
packages during the initialization of the pkg_resources runtime, and also
the need for pkg_resources to be explicitly imported before any namespace
packages work at all.

This entire section could be moved to your new blurb about transitioning.

https://github.com/pypa/setuptools/blob/main/docs/development/index.rst#development-on-setuptools

This document assumes the reader has some passing familiarity with
using setuptools, the pkg_resources module, and pip.
[...]
as all of these subjects are
covered at length in the setuptools developer's guide and the
pkg_resources reference manual.

https://github.com/pypa/setuptools/blob/main/docs/references/keywords.rst#user-content-keyword-namespace-packages

The namespace_packages implementation relies on pkg_resources. However, pkg_resources has some undesirable behaviours,

https://github.com/pypa/setuptools/blob/main/docs/userguide/distribution.rst#specifying-your-projects-version

If you want to be certain that your chosen numbering scheme works the way
you think it will, you can use the pkg_resources.parse_version() function
to compare different version numbers::

https://github.com/pypa/setuptools/blob/main/docs/userguide/extension.rst#adding-new-egg-info-files

Some extensible applications or frameworks may want to allow third parties to
develop plugins with application or framework-specific metadata included in
the plugins' EGG-INFO directory, for easy access via the pkg_resources
metadata API.

https://github.com/pypa/setuptools/blob/main/docs/userguide/package_discovery.rst#legacy-namespace-packages

Historically, there were two methods to create namespace packages. [...]

The historical mention of setuptools + pkgutils can stay. But I'm not sure if it should still give the full example on using them. At least it should be clarified that this is not only deprecated, but no longer supported at all. Either way pkg_resource is a typo and missing s

https://github.com/pypa/setuptools/blob/main/docs/userguide/development_mode.rst#limitations Not sure about this one. Maybe it could be rephrased ?

Editable installations may not work with
:doc:namespaces created with pkgutil or pkg_resources <PyPUG:guides/packaging-namespace-packages>.
Please use :pep:420-style implicit namespaces [#namespaces]_.

https://github.com/pypa/setuptools/blob/main/docs/userguide/pyproject_config.rst#setuptools-specific-configuration

Obsolete - only relevant for pkg_resources, [...]

https://github.com/pypa/setuptools/blob/main/setuptools/dist.py

install_requires' -- a string or sequence of strings specifying project
versions that the distribution requires when installed, in the format
used by 'pkg_resources.require()'


Additional notes (not in scope of this PR): #5007 (comment)

@abravalheri
Copy link
Contributor Author

Thanks @Avasam. I am tempted to create a new issue with your whole comment and split it up with follow up(s) PR(s) -- just because in this moment I want the info to get out there (and it will take me time to iterate over all the points you suggested).

Also, any further suggestion to improve the text can be revisited in a later PR.

@abravalheri abravalheri merged commit 7065935 into pypa:main Feb 10, 2026
20 of 22 checks passed
@abravalheri abravalheri deleted the pkg_resources_docs branch February 10, 2026 02:17
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.

Setuptools should not rely on pkg_resources

2 participants