From 12d8d5bf24a7df54e70f94f68d705a1f6bb11f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Fri, 10 Jan 2025 15:28:58 +0100 Subject: [PATCH] [tools] Simplify static file handling in report-converter for Python 3.12 The report-converter package shows setuptools warnings during build about missing packages when using Python 3.12. This is due to stricter package discovery checks introduced in setuptools 61.0.0 [1], which now warns about directories that could be packages but aren't explicitly configured. While we could address this with explicit package_data configuration, the package already has a correct MANIFEST.in file that handles static file inclusion. This change: - Removes redundant package_data configuration from setup.py - Relies on the existing MANIFEST.in pattern for static files - Uses find_namespace_packages() to properly handle package structure - Keeps include_package_data=True to ensure MANIFEST.in is respected This approach is more maintainable as: 1. All static file patterns are managed in one place (MANIFEST.in) 2. New static files are automatically included if they follow the existing directory structure 3. setuptools will warn us if files specified in MANIFEST.in are missing The change makes the package compatible with Python 3.12's stricter package discovery while maintaining a clean and maintainable solution for static file handling. [1] https://setuptools.pypa.io/en/latest/history.html#v61-0-0 [2] https://setuptools.pypa.io/en/latest/userguide/package_discovery.html --- tools/report-converter/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/report-converter/setup.py b/tools/report-converter/setup.py index a4812a3898..c4e6360e28 100644 --- a/tools/report-converter/setup.py +++ b/tools/report-converter/setup.py @@ -21,8 +21,8 @@ url="https://github.com/Ericsson/CodeChecker", keywords=['report-converter', 'codechecker', 'plist'], license='LICENSE.txt', - packages=setuptools.find_packages(), - include_package_data=True, + packages=setuptools.find_namespace_packages(include=['codechecker_report_converter*']), + include_package_data=True, # This will use MANIFEST.in classifiers=[ "Environment :: Console", "Intended Audience :: Developers",