On 5/29/25 2:16 AM, Michał Górny wrote:
> Add an explicit check for namespace packages (both pkg_resources
> and pkgutil) to 60python-site.


pkgutil is stdlib and also not really deprecated.



> The eclass handled the most common
> case of installing them via the deprecated `namespace_packages`
> setuptools key, but it does not handle packages that worked around
> the deprecation warning by installing the file manually.


Projects don't always "install the file manually". Sometimes they have
code which needs to run in __init__.py but *also* need to expose the
namespace to other code.

Since pkgutil is compatible with implicit namespaces, the answer is to
have subpackages use implicit and the main package use pkgutil + custom
code.

It's not a bug or a QA issue unless the subpackage also installs its own
__init__.py.

We should not report pkgutil. I agree catching manual pkg_resources
usage makes sense.


> Signed-off-by: Michał Górny <[email protected]>
> ---
>  metadata/install-qa-check.d/60python-site | 24 +++++++++++++++++++++++
>  1 file changed, 24 insertions(+)



-- 
Eli Schwartz

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to