Commit graph

5,102 commits

Author SHA1 Message Date
41ca202142
cmds.projects.CmdBuild: Support --dep-flavours
CmdBuild supports the targets all, clean and pkg-*. It uses builtin
dependency flavours matching those targets to resolve build order. To
make it more flexible in general, and allow it to support more
targets, e.g. "check" and "test", this commit adds a --dep-flavours
option.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:35:27 +02:00
b7431e5bc6
rules.mk / defs.mk: Disable BUILD_MAKEDIR
BUILD_MAKEDIR is a variable which exists for consistency's sake. On
the other hand, nor jw-pkg nor any downstream package ever copies
makefile snippets during build time. The rule introduced by
BUILD_MAKEDIR is quite costly in terms of performance and makes
caching harder to understand. This commit disables the variable.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:34:08 +02:00
79edaff1dd
py-path.mk: Add target py-path
Add target py-path to py-path.mk. At this point, it's mostly
introduced for documentation purposes, giving people and machines a
defined, easily accessible and omni-present way to determine how
Python imports should be resolved.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:32:51 +02:00
4bf6445412
py-check.mk: Add target py-check-bad-patterns
Add target py-check-bad-patterns, which currently looks for leftover
breakpoints and orphaned "export" comments on the closing line of a
function prototype.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:31:34 +02:00
dcbe959843
lib: Fix misplaced "# export" markers
A couple of "# export" markers after function prototypes have been
pushed along with the closing parenthesis onto the wrong line by the
code formatter, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:30:17 +02:00
eea3e5f14b
py-check.mk: Add file
Add py-check.mk and use it from py-topdir.mk and py-rules.mk. This
removes redundant check definitions, making sure that that checks run
from a repo's subdirectory match the checks run from its toplevel
directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:28:59 +02:00
c63b3cc06f
py-defs.mk: Allow inclusion without defs.mk
py-defs.mk uses the variables ECHO and SED defined in defs.mk. The
complexity this introduces doesn't justify the reduced redundancy,
though, so this commit defines them redundantly in py-defs.mk and to
allow inclusion without prior defs.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:27:43 +02:00
6743808000
py-run.mk: Remove dead code
Remove disabled included statements which are not going to be enabled
anymore.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:26:26 +02:00
d59dba37e0
ldlibpath.mk: Don't include py-path.mk anylonger
For backwards compatibility, ldlibpath.mk kept py-path.mk included.
The projects depending on that have been fixed by now and this is no
longer needed. So, move it to the py-defs.mk where it belongs and has
narrower scope.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:25:09 +02:00
100d8f9abb
test/integration/jw-pkg/projects/cache: Add directory
Add tests for jw-pkg.py calls run during makefile caching. Broken
caching can compromise the build without causing it to fail entirely,
i.e. in non-obvious ways.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:23:52 +02:00
c8ffae57fc
test/integration/jw-pkg/projects: Add directory
Add a directory for integration tests of "jw-pkg projects".

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:22:37 +02:00
1062be24db
App: Remove hardcoded local/src from App and defs.mk
local/src is a janware-specific path, remove it from App and defs.mk.
It's still in pkg.sh as a safety measure. Will have to go, too, but
is kept in for now until further audit.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:20:18 +02:00
701d8a33e7
lib.ec.ssh.Paramiko: Tolerate import-not-found
Tolera$te missing paramiko imports. jw-pkg is designed to
work with what it finds and use plain /usr/bin/ssh if need
be.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:08:28 +02:00
4f91d47b25
Release 1.0.0-248@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m40s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m13s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-07-22 23:11:19 +00:00
5b4710b613
Start version: 1.0.0-248
Signed-off-by: janware DevOps <devops@janware.com>
2026-07-22 23:10:13 +00:00
36af4a590f
py-xxx.mk: Clean more python tool caches
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m6s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m6s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m2s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m54s
CI / Packaging test (push) Successful in 0s
.mypy_cache, .ruff_cache and .pytest_cache are not consistently
cleaned in all subdirectories. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 14:41:38 +02:00
d90c0ebf18
cache.mk: Include from topdir.mk, not make.mk
During a topdir "make all", caching variables is currently not the
first thing that happens. Instead, variables are cached as soon as a
project recurses into the make subdirectory. That was necessary,
because some makefiles were regenerated in the make subdirectory by
autoconf, potentially contributing variables that needed to be
cached.

As of now, autoconf is long gone and this is no longer true. And for
some variables, the two step process becomes involved, notably for
PYTHONPATH, which coding agents would like to look at from the topdir
very early on.

This commit moves the .project-cache.mk creation to topdir.mk, and
.projects-cache.mk creation to jw-pkg/Makefile to address that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 14:38:24 +02:00
193c2ee0bd
py-topdir.mk: PY_CHECK_ROOTS: Don't += assign
py-topdir.mk has this:

  ifndef PY_CHECK_ROOTS
    PY_CHECK_ROOTS += ...
  endif

That is too involved: Either PY_CHECK_ROOTS is defined, then nothing
is appended, or it's undefined, then a simple "=" would be just fine.
Use that instead.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 12:34:05 +02:00
6325f9ea19
platform.mk: Fix make -C $(TOPDIR)/make clean all
If run from $(TOPDIR), "make clean all" runs fine, because it
recurses twice into $(TOPDIR)/make, once for every target. If invoked
directly from $(TOPDIR)/make, it can break in two different ways:

If the cache files don't exist, "make clean all" in $(TOPDIR)/make
tries to create them too early as implicit make target. This leaves
variables empty which should have a value.

If the cache files do exist, "make clean all" in $(TOPDIR)/make
includes them, cleans them, and re-creates them from the same
variables just read from cache. Undesirable for cache purging.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 12:34:05 +02:00
11ccaef832
cmds.projects.CmdPythonpath: Reverse PYTHONPATH
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m48s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m55s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m46s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m54s
CI / Packaging test (push) Successful in 0s
CmdPythonpath, AKA pythonpath, prints a PYTHONPATH which runs from
root first to dependency leaves last. This works now but doesn't
give local overrides the advantage it should. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 12:01:30 +02:00
60bd4b461b
cmds.projects.CmdCreateFile: Add self to extra_paths
pyrightconfig.json as generated by CmdCreateFile, doesn't contain the
repository's own Python source location in "extra_paths", fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 12:01:29 +02:00
96409e50f7
lib.Uri: Treat paths starting with "~" specially
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m50s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m51s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m50s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m10s
CI / Packaging test (push) Successful in 0s
An Uri instance constructed from "~/some/path" returns
"file://~/some/path" as the .full property, i.e. with the "~" in the
authority part. That's not accurate and doesn't make the intended
sense in an URL context, see RFC 8089:

  Common UNIX shells such as the Bourne-Again SHell (bash) and Z
  SHell (zsh) provide a function known as "tilde expansion"
  [Bash-Tilde] or "filename expansion" [Zsh-Tilde], where a path
  that begins with a tilde character "~" can be expanded out to a
  special directory name.  No such facility exists using the file
  URI scheme; a tilde in a file URI is always just a tilde.

The "fix" introduced by this commit makes .full return the path
without file:// prepended. That's conservative. It could also chose
to expand the tilde, which is arguably cleaner. To be introduced by a
later change after this commit has seen more coverage.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 11:40:56 +02:00
2c38c8a144
lib.distros.suse.Distro: Fix duplicate zypper opts
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m16s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m10s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m48s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m17s
CI / Packaging test (push) Successful in 0s
In non-interactive mode, "zypper dup" runs with the options
--force-resolution and --auto-agree-with-licenses duplicated, fix
that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 11:06:58 +02:00
7f19432360
lib.Types: Exception log beautification
Be a bit more verbose if a broken (i.e. non-class-type) type filter
parameter gets passed.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 11:06:58 +02:00
db09928ffa
cmds.projects.CmdBuild: Code and log beautification
Improve CmdBuild some more:

 - Fix more broken f-strings
 - Better varable name prereq_type -> dep_flavour
 - Add stricter typing
 - Beautify logging

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 11:06:58 +02:00
d3e581f03d
create-mkspec.sh: Tolerate comma-separated subpackages
subpackages = "run, devel" is not tolerated by create-mkspec.sh. It
expects "run devel", which goes against the grain of the other
metadata, so make it at least tolerate the more common
comma-separated variant.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 11:06:58 +02:00
670472abf5
cmds.CmdPlatform: Fix typo "comamnds" -> "commands"
CmdPlatform's help message contains the string "comamnds", fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 11:06:58 +02:00
8ba2b2434a
lib.ProjectConf: Remove empty line
yapf complains about a superfluous empty line, remove it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 11:06:58 +02:00
77d2cfb347
Release 1.0.0-247@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m26s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m17s
CI / Packaging test (push) Successful in 0s
2026-07-05 23:29:56 +00:00
9137d139bd
Release 1.0.0-247@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m3s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m11s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-07-05 23:11:23 +00:00
a35aef040b
Start version: 1.0.0-247
Signed-off-by: janware DevOps <devops@janware.com>
2026-07-05 23:10:17 +00:00
7820fde4e6
test: Fix test.py duplicate module name error
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m17s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m9s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m19s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m59s
CI / Packaging test (push) Successful in 0s
Mypy scans both src/python/ and test/ under the same jw namespace,
and finds three test files named test.py. Without a package root at
the test/ level, mypy resolves all of them to the bare module name
test, and rejects them as duplicates.

Add __init__.py at test/ marks it as a package root, so each test.py
resolves to a unique full path, e.g.

  test.unit.python.jw.pkg.lib.Result.test

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:35:17 +02:00
8734b90f72
test: apply yapf formatting to test.py files
Yapf complains about spacing inconsistencies around assignment operators
in function calls, fix that.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:35:17 +02:00
ad9c5b581a
lib.ProjectConf: Clean up temp files
The _load() helper in test/unit/python/jw/pkg/lib/ProjectConf/test.py
uses tempfile.NamedTemporaryFile(..., delete=False) but never removes
the created files. Each test call leaked a .conf file in /tmp.

Track all created paths in a _tmpfiles list and call _cleanup() at the
end of the test to unlink them.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:35:06 +02:00
00b632d1cd
lib.Distro: Fix typo instaniate to instantiate
Two error messages in Distro.__init__() contain the typo 'instaniate'
instead of 'instantiate'. Fix the spelling.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:29:11 +02:00
95a2d8a867
lib.DistroContext: Remove dead code from install()
Remove unused helper functions from install():
_matches_host_prefix(), _crop_host_prefix(), _crop_default_prefix(),
and _matches_default_prefix().

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:25:09 +02:00
a45af032f4
lib.CmdBuild.add_dep_tree(): Fix broken f-string
log() uses a regular string instead of an f-string, fix that.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:23:54 +02:00
62803a4a1b
lib.Uri: Return 'file' scheme for local paths
The scheme property returns 'file://' for local paths instead of
'file', causing scheme_plus_authority to produce 'file://://' with a
triple slash.

Also fix the test to expect 'file' instead of 'file://'.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:21:43 +02:00
7d8994bcfe
lib.CopyContext._run(): Fix infinite recursion
The CopyContext._run() calls await self._run(), which would create
infinite recursion raising RecursionError at runtime. Make it a pure
virtual.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:13:27 +02:00
0020f4b976
Release 1.0.0-246@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m16s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m18s
CI / Packaging test (push) Successful in 0s
2026-07-02 23:28:31 +00:00
143369fb46
Release 1.0.0-246@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m21s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m26s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-07-02 23:10:46 +00:00
aabfa293f3
Start version: 1.0.0-246
Signed-off-by: janware DevOps <devops@janware.com>
2026-07-02 23:09:40 +00:00
0c92d942ec
py-test.mk: Generate conftest.py
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m21s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m40s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m6s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m12s
CI / Packaging test (push) Successful in 0s
Generate a standard conftest.py, mostly for customizing pytest's
bombastic test header, which otherwise lets the more informative make
output look too pale in comparison.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-02 19:52:35 +02:00
52f34a915d
py-test.mk: Add file
Add a dedicated py-test.mk for running tests with pytest instead of
python.

The commit introduces a new variable PYTHON_RUNNER, which is then
used by py-run.mk to do it's usual thing. Running pytest is similar
enough to running Python programs to keep the rest of the machinery
and prevent redundancy from creeping in.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-02 19:52:35 +02:00
ac54a7bca6
make: Make target "test" depend on target "all"
Every directory should have a test target, and the test target should
depend on all so that all files are generated that might be needed
for testing. This commit fixes some missing targets, and adds some
missing dependencies.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-02 19:52:35 +02:00
48b7df3b78
Release 1.0.0-245@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m7s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m20s
CI / Packaging test (push) Successful in 0s
2026-06-30 23:33:33 +00:00
1a2ed46f04
Release 1.0.0-245@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m33s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-30 23:12:21 +00:00
2691f90b35
Start version: 1.0.0-245
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-30 23:11:15 +00:00
a2a4312f5b
App.get_values(): Filter out empty split results
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m20s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m29s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m14s
CI / Packaging test (push) Successful in 0s
get_values() splits comma-separated values and strips whitespace but
does not filter out empty strings. A value like "a, b, " produces
['a', 'b', ''], with an empty string at the end. This empty string
propagates to callers like CmdRequiredOsPkg.py and pollutes output.
Add a filter for non-empty stripped values.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-30 15:07:42 +02:00
42f064de89
App.get_value(): Fix FileNotFoundError regression
The refactored __get_project_conf() raises FileNotFoundError when
project.conf does not exist, whereas the original read_value()
returns None. This causes get_value() to crash for projects with
missing or incomplete project.conf files.

Catch FileNotFoundError in __get_project_conf() and return None to
restore original behavior. Remove redundant @cache from
__read_project_conf() since __get_project_conf() already provides
caching.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-30 15:07:24 +02:00