Skip to content

Use `find_namespace_packages` to properly package LC_MESSAGES locales

find_packages currently packages them because they contain data, but this behavior is deprecated and using find_namespace_packages is suggested.

See https://kojipkgs.fedoraproject.org//packages/python-postorius/1.3.8/1.fc39/data/logs/noarch/build.log

The build contains multiple occurences of this warning

  !!
    check.warn(importable)
  /usr/lib/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'postorius.locale.am.LC_MESSAGES' as data is deprecated, please list it in `packages`.
      !!
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'postorius.locale.am.LC_MESSAGES' as an importable package,
      but it is not listed in the `packages` configuration of setuptools.
      'postorius.locale.am.LC_MESSAGES' has been automatically added to the distribution only
      because it may contain data files, but this behavior is likely to change
      in future versions of setuptools (and therefore is considered deprecated).
      Please make sure that 'postorius.locale.am.LC_MESSAGES' is included as a package by using
      the `packages` configuration field or the proper discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).
      You can read more about "package discovery" and "data files" on setuptools
      documentation page.

Signed-off-by: Michel Alexandre Salim salimma@fedoraproject.org

Merge request reports