Bug#1084010: Migrating away from pkg_resources is difficult for namespace packages
- To: 1084006@bugs.debian.org, 1084007@bugs.debian.org, 1084008@bugs.debian.org, 1084009@bugs.debian.org, 1084010@bugs.debian.org, 1084011@bugs.debian.org, 1084012@bugs.debian.org, 1084013@bugs.debian.org, 1084014@bugs.debian.org, 1084015@bugs.debian.org, 1084016@bugs.debian.org, 1084017@bugs.debian.org, 1084018@bugs.debian.org, 1084019@bugs.debian.org, 1084020@bugs.debian.org, 1083457@bugs.debian.org, 1083458@bugs.debian.org, 1083460@bugs.debian.org, 1083461@bugs.debian.org
- Cc: Matthias Klose <doko@debian.org>
- Subject: Bug#1084010: Migrating away from pkg_resources is difficult for namespace packages
- From: Colin Watson <cjwatson@debian.org>
- Date: Fri, 4 Oct 2024 11:22:32 +0100
- Message-id: <[🔎] Zv_B6KbMbNJEltA4@riva.ucam.org>
- Reply-to: Colin Watson <cjwatson@debian.org>, 1084010@bugs.debian.org
- References: <[🔎] E1swezY-00DiGR-UQ@paradis.debian.org>
While pkg_resources is indeed deprecated upstream, there's nothing that
we can sensibly do about it at the Debian level in lazr.* or zope.*, and
it's not even as clear as you might hope what to do upstream. They all
do something like this in an __init__.py (with unimportant variations):
__import__('pkg_resources').declare_namespace(__name__)
As
https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#pkg-resources-style-namespace-packages
says:
If you are creating a new distribution within an existing namespace
package that uses this method then it’s recommended to continue using
this as the different methods are not cross-compatible and it’s not
advisable to try to migrate an existing package.
I know pkg_resources is deprecated for most other purposes, but even
upstream currently advises here not to try to migrate in this case.
Now, I know there've been some attempts to figure this out:
https://github.com/pypa/sample-namespace-packages thinks a migration may
be possible as long as developers are willing to accept some
limitations. But it's still a difficult migration and upstream hasn't
really got going on it; for Zope, see
https://github.com/zopefoundation/meta/issues/194.
Please can you reconsider, and not force this for Debian trixie? I
think we need to keep pkg_resources around for this use case until a
good deal more work has been done on migrating away from it for
namespace packages.
--
Colin Watson (he/him) [cjwatson@debian.org]
Reply to: