ansible-community / ara

ARA Records Ansible and makes it easier to understand and troubleshoot.

Home Page:https://ara.recordsansible.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setuptools deprecation notice when building with python3.11

dmsimard opened this issue · comments

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.

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.

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.