ansible-community / ara

ARA Records Ansible and makes it easier to understand and troubleshoot.
https://ara.recordsansible.org
GNU General Public License v3.0
1.82k stars 169 forks source link

setuptools deprecation notice when building with python3.11 #503

Open dmsimard opened 10 months ago

dmsimard commented 10 months ago

What is the issue ?

When building a wheel with python3 setup.py sdist bdist_wheel there are warnings such as:

/tmp/release/lib64/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'ara.api.management.commands' as data is deprecated, please list it in `packages`.
    !!

    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'ara.api.management.commands' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'ara.api.management.commands' 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 'ara.api.management.commands' 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.

!!

  check.warn(importable)

The full list is the following:

Installing 'ara.api.management.commands' as data is deprecated, please list it in `packages`.
Installing 'ara.plugins.action' as data is deprecated, please list it in `packages`.
Installing 'ara.plugins.callback' as data is deprecated, please list it in `packages`.
Installing 'ara.plugins.lookup' as data is deprecated, please list it in `packages`.
Installing 'ara.server.db.backends' as data is deprecated, please list it in `packages`.
Installing 'ara.server.db.backends.distributed_sqlite' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.management.commands' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.static' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.static.css' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.static.images' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.static.js' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.templates' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.templates.partials' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.templates.partials.search' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.templates.partials.tables' as data is deprecated, please list it in `packages`.
Installing 'ara.ui.templatetags' as data is deprecated, please list it in `packages`.

I have not yet investigated the issue but we should understand and fix the deprecation.

What should be happening ?

We should be able to build without running into deprecations.

gotmax23 commented 10 months ago

Those directories are missing __init__.py files, so they're not proper Python packages, and setuptools.find_packages() (used by pbr under the hood) does not explicitly include them in setuptools' packages configuration. Adding __init__.py files should fix this problem.

dmsimard commented 10 months ago

Thanks for pointing me in the right direction!

Some of those aren't meant to be python modules, most notably the UI bits, but we can figure it out.

dmsimard commented 3 weeks ago

This is a build issue, not a runtime issue and it seems like we should use something else anyway:

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

I'll revisit this later.