project.conf, py-topdir.mk: Fix check target for Kali

"make check" fails on Kali Linux, because the machinery lacks pieces:

- Add mypy, yapf3, python3-pyright to project.conf for Debian. The pyright package is not in upstream Kali, but is now supplied by the jw-foss repo.
- ifdef ruff out from "make check" in py-topdir.mk, because it's too much work to get that to work from packages on Kali Linux for now.

project.conf, py-topdir.mk: Make Kali work

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-06-02 12:55:15 +02:00
commit f1456f1d46
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
2 changed files with 20 additions and 6 deletions

View file

@ -21,7 +21,7 @@ devel = jw-pkg-run = VERSION-REVISION
run = bash, python3
build = make, time, xdg-utils, coreutils, cpio, xdg-utils, git-core
devel = sudo, gawk, pkg-config
release = python3-isort, python3-yapf, python3-ruff, python3-pyright
release = mypy, python3-isort, python3-yapf, python3-pyright
[pkg.requires.centos]
run = hostname, python
@ -36,11 +36,11 @@ build = realpath
[pkg.requires.suse]
run = python3
release = rpmbuild, python3-base
release = rpmbuild, python3-base, python3-yapf
[pkg.requires.debian]
run = python3
release = devscripts, debhelper, dput, libparse-debcontrol-perl, fakeroot, build-essential:native
release = devscripts, debhelper, dput, libparse-debcontrol-perl, fakeroot, build-essential:native, yapf3
[pkg.requires.yocto]
run = python3-core

View file

@ -4,6 +4,14 @@ TD_GENERATE_FILES += pyrightconfig.json
PY_CHECK_EXCLUDE ?=
PY_SRC_ROOT += $(wildcard $(TOPDIR)/src $(TOPDIR)/tools)
ifndef PY_CHECK_RUFF
PY_CHECK_RUFF := $(shell which ruff 2>/dev/null)
endif
ifndef PY_CHECK_YAPF
PY_CHECK_YAPF := $(firstword $(wildcard /usr/bin/yapf /usr/bin/yapf3))
endif
all:
format: py-format
@ -12,17 +20,23 @@ check-format: py-check-format
py-check: py-check-syntax py-check-format
py-check-syntax:
ruff check $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_SRC_ROOT)
ifneq ($(PY_CHECK_RUFF),)
$(PY_CHECK_RUFF) check $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_SRC_ROOT)
endif
mypy $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_SRC_ROOT)
pyright
py-check-format:
yapf --diff --recursive .
ifneq ($(PY_CHECK_YAPF),)
$(PY_CHECK_YAPF) --diff --recursive .
endif
py-format:
find . -type f -name '*.py' -print0 | \
xargs -0 sed -i -E '1{/^# -\*- coding: utf-8 -\*-$$/{:a;N;/\n[[:space:]]*$$/ba;s/^# -\*- coding: utf-8 -\*-\n([[:space:]]*\n)*/ /;s/^ //}}'
yapf --in-place --recursive .
ifneq ($(PY_CHECK_YAPF),)
$(PY_CHECK_YAPF) --in-place --recursive .
endif
py-format-assignments:
find . \