inbo / niche_vlaanderen

Python package to run the NICHE Vlaanderen model
https://inbo.github.io/niche_vlaanderen/
MIT License
5 stars 2 forks source link

Deprecation warning when building package #356

Closed johanvdw closed 5 months ago

johanvdw commented 1 year ago

The package still builds correctly, but we should likely adjust it for the next release.

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

    'niche_vlaanderen.system_tables' 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 'niche_vlaanderen.system_tables' 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.
stijnvanhoey commented 5 months ago

According to the setuptools doc, https://setuptools.pypa.io/en/latest/userguide/datafiles.html#subdirectory-for-data-files we should

In this case, the recommended approach is to treat data as a namespace package (refer PEP 420). This way, you can rely on the same methods described above, using either package_data or include_package_data.

stijnvanhoey commented 5 months ago

See https://github.com/inbo/niche_vlaanderen/pull/372