From 1fa738553e31127465bd6c594c2201fb916e26d6 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 10 Nov 2026 06:57:37 +0100 Subject: [PATCH 1/2] lib.FilesContext: Drop unused and duplicate imports test Ruff complains about unused and duplicate imports in FilesContext's test, fix that. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0 Signed-off-by: Jan Lindemann --- .../python/jw/pkg/cmds/secrets/lib/FilesContext/test.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/unit/python/jw/pkg/cmds/secrets/lib/FilesContext/test.py b/test/unit/python/jw/pkg/cmds/secrets/lib/FilesContext/test.py index 11937687..4e8920ef 100644 --- a/test/unit/python/jw/pkg/cmds/secrets/lib/FilesContext/test.py +++ b/test/unit/python/jw/pkg/cmds/secrets/lib/FilesContext/test.py @@ -4,19 +4,15 @@ import asyncio import grp import os import pwd -import sys import tempfile -from typing import TYPE_CHECKING, override +from typing import override from jw.pkg.cmds.secrets.lib.base import Attrs from jw.pkg.cmds.secrets.lib.FilesContext import FilesContext from jw.pkg.lib.ec.Local import Local from jw.pkg.lib.PathFilter import Verdict -if TYPE_CHECKING: - import os - # -- A context whose package space holds only the template, as on a # real host: the output file and the temp are not package files. # If the compile's own file operations honor the filter, the -- 2.56.1 From 8752440bc0ac69496dfa2d81a8fe8b4c0428f816 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 10 Nov 2026 10:54:33 +0100 Subject: [PATCH 2/2] topdir.mk, project.conf: Add new dep flavour "lint" Add a new dependency flavour named "lint", in addition to the existing flavours run, build, devel and release, to declare the dependencies needed for static linting. Those are deliberately not lumped into the build flavour, because that might add dependencies that are hard to satisfy on some platforms that should remain buildable. Start easy, with OpenSUSE only, because Tumbleweed provides pyright and ruff in its core repositories. That should be enough for a first canary in CI. Tighter linting should be added by follow-up PRs. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.1 Signed-off-by: Jan Lindemann --- make/project.conf | 1 + make/topdir.mk | 2 +- .../jw/pkg/cmds/projects/BaseCmdPkgRelations.py | 2 +- test/integration/jw_pkg/help/test-expected.txt | 16 ++++++++-------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/make/project.conf b/make/project.conf index 9641d6d5..4827ad7e 100644 --- a/make/project.conf +++ b/make/project.conf @@ -37,6 +37,7 @@ build = realpath [pkg.requires.suse] run = python3 release = rpmbuild, python3-base +lint = python3-ruff, python3-pyright [pkg.requires.debian] run = python3 diff --git a/make/topdir.mk b/make/topdir.mk index 3d51c7fa..bfd71b90 100644 --- a/make/topdir.mk +++ b/make/topdir.mk @@ -303,7 +303,7 @@ pkg-install-release-deps: $(PKG_MANAGER) install $(shell $(proj_query_cmd) required-os-pkg --quote "build,run,release" $(PROJECT)) pkg-install-testbuild-deps: - $(PKG_MANAGER) install $(shell $(proj_query_cmd) pkg-requires --quote --hide-self --syntax names-only --delimiter " " "build,run,devel,release" $(PROJECT)) + $(PKG_MANAGER) install $(shell $(proj_query_cmd) pkg-requires --quote --hide-self --syntax names-only --delimiter " " "lint,build,run,devel,release" $(PROJECT)) recache-vars: rm -f $(TOPDIR)/make clean-cache cache diff --git a/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py b/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py index 98c42c27..1d01b69a 100644 --- a/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py +++ b/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py @@ -71,7 +71,7 @@ class BaseCmdPkgRelations(Cmd): ) parser.add_argument( 'flavours', - help = 'Dependency flavours (run, build, devel, release), ' + help = 'Dependency flavours (lint, run, build, devel, release), ' 'separated by comma or whitespace' ) parser.add_argument('modules', nargs = '*', help = 'Modules') diff --git a/test/integration/jw_pkg/help/test-expected.txt b/test/integration/jw_pkg/help/test-expected.txt index 0c711ccf..ed24656b 100644 --- a/test/integration/jw_pkg/help/test-expected.txt +++ b/test/integration/jw_pkg/help/test-expected.txt @@ -557,8 +557,8 @@ usage: jw-pkg.py projects pkg-conflicts [-h] [-S [SUBSECTIONS]] Print packages conflicting with a given package positional arguments: - flavours Dependency flavours (run, build, devel, release), - separated by comma or whitespace + flavours Dependency flavours (lint, run, build, devel, + release), separated by comma or whitespace modules Modules (default: None) options: @@ -608,8 +608,8 @@ usage: jw-pkg.py projects pkg-provides [-h] [-S [SUBSECTIONS]] Print packages and capabilities provided by a given package positional arguments: - flavours Dependency flavours (run, build, devel, release), - separated by comma or whitespace + flavours Dependency flavours (lint, run, build, devel, + release), separated by comma or whitespace modules Modules (default: None) options: @@ -660,8 +660,8 @@ usage: jw-pkg.py projects pkg-recommends [-h] [-S [SUBSECTIONS]] Print recommended packages positional arguments: - flavours Dependency flavours (run, build, devel, release), - separated by comma or whitespace + flavours Dependency flavours (lint, run, build, devel, + release), separated by comma or whitespace modules Modules (default: None) options: @@ -711,8 +711,8 @@ usage: jw-pkg.py projects pkg-requires [-h] [-S [SUBSECTIONS]] Print packages required for a given package positional arguments: - flavours Dependency flavours (run, build, devel, release), - separated by comma or whitespace + flavours Dependency flavours (lint, run, build, devel, + release), separated by comma or whitespace modules Modules (default: None) options: -- 2.56.1