From b14d67297583789fa846d0dd70d47930374671fc Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Wed, 2 Sep 2026 19:38:59 +0200 Subject: [PATCH] packaging: make LZF coredump support optional The lzf package only ships a source distribution and needs Python development headers to build. Normal NuttX CI runs do not use syslog coredumps. Move lzf to the coredump extra and import the syslog handler only when that backend is enabled. Signed-off-by: raiden00pl --- pyproject.toml | 6 +++++- src/ntfc/debug/coredump/syslog_handler.py | 2 +- src/ntfc/debug/getdebug.py | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f4fe325..9c6ddc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,6 @@ dependencies = [ "pexpect", "psutil", "pyserial", - "lzf", "pytest", "pytest-dependency", "pytest-html", @@ -54,6 +53,11 @@ keywords = [ "ntfc", ] +[project.optional-dependencies] +coredump = [ + "lzf", +] + [project.scripts] ntfc = "ntfc.cli.main:main" diff --git a/src/ntfc/debug/coredump/syslog_handler.py b/src/ntfc/debug/coredump/syslog_handler.py index 75cd73e..92ca249 100644 --- a/src/ntfc/debug/coredump/syslog_handler.py +++ b/src/ntfc/debug/coredump/syslog_handler.py @@ -25,7 +25,7 @@ import struct from typing import TYPE_CHECKING, Optional -import lzf # type: ignore[import-untyped] +import lzf # type: ignore from ntfc.debug.coredump.base import CoredumpHandler from ntfc.log.logger import logger diff --git a/src/ntfc/debug/getdebug.py b/src/ntfc/debug/getdebug.py index 095b024..faf02bc 100644 --- a/src/ntfc/debug/getdebug.py +++ b/src/ntfc/debug/getdebug.py @@ -27,7 +27,6 @@ from ntfc.debug.coredump.gdb_handler import GdbHandler from ntfc.debug.coredump.local_file_handler import LocalFileHandler from ntfc.debug.coredump.manager import CoredumpManager -from ntfc.debug.coredump.syslog_handler import SyslogHandler from ntfc.debug.coredump.ymodem_handler import YmodemHandler from ntfc.debug.gdb.controller import GdbController from ntfc.lib.fastboot.controller import FastbootController @@ -230,6 +229,8 @@ def _register_coredump_handlers( mgr.register(LocalFileHandler(cfg.local_file)) if cfg.syslog.enable: + from ntfc.debug.coredump.syslog_handler import SyslogHandler + mgr.register(SyslogHandler(product.core(0).device))