use find_namespace_packages() to fix installing data subdirs

Fixes the deprecation warnings resembling the following:

    Installing 'icalendar.tests.hypothesis' as data is deprecated, please list it in `packages`.
    !!

    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'icalendar.tests.hypothesis' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'icalendar.tests.hypothesis' 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 'icalendar.tests.hypothesis' 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.

This is one of two possible solutions.  The other option is to add
__init__.py files to all subdirectories of icalendar/tests.
pull/462/head
Michał Górny 2022-10-18 07:53:14 +02:00
rodzic bf408b8f15
commit bdc5b6317b
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -52,7 +52,7 @@ setuptools.setup(
author_email='plone-developers@lists.sourceforge.net',
url='https://github.com/collective/icalendar',
license='BSD',
packages=setuptools.find_packages('src'),
packages=setuptools.find_namespace_packages('src'),
package_dir={'': 'src'},
include_package_data=True,
zip_safe=False,