Commit graph jw-pkg/make
Author SHA1 Message Date
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
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
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
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
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
03325ab7f5
test-jw-pkg.mk: Add file
Add include file to provide some definitions for a first integration
test suite. It provides the shared make variables, most notably
TEST_CMD_LINE as handy default for running jw-pkg.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-25 14:38:22 +02:00
2c7edc9d44
profile|std-targets.mk: Add empty test target
Recursive make fails in scripts/usr-bin when driven through jw-pkg.
Add empty test targets to remedy that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-25 14:37:02 +02:00
50da3a6f31
rules.mk: Remove debug $(info) for EXE_SH
The debug line "$(info EXE_SH=>$(EXE_SH)<)" was left in during
development. Remove it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-25 14:36:55 +02:00
3aecb6c685
rules.mk: Add targets to check shell syntax
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m3s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m33s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m23s
CI / Packaging test (push) Successful in 0s
Add the target sh-syntax-check, which triggers bash syntax linting
with shellcheck This commit stops short of making target all depend
on it, because the fallout is impressive.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:52:35 +02:00
e59d37e907
defs.mk: Use EXE_SH for shell scripts only
To make EXE_SH useful for automated shell syntax checking, remove all
non POSIX shell / bash scripts from that variable, and place the
non-shell scripts into EXE_SCRIPTS.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:52:35 +02:00
80cafa4737
defs.mk: Add *.slice to LOCAL_SYSTEMD
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m3s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m7s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m1s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m9s
CI / Packaging test (push) Successful in 0s
Support automatic installation of *.slice files into the system's
systemd directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:43:11 +02:00
04b5088ca4
defs.mk: Minor code beautification
Uppercase some comments, and remove some dead code.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:43:11 +02:00
2cafd60b71
platform.mk: Support PREREQ_RUN_ADD
Modifying JW_PKG_XXX_PATH in pre-local.mk is fragile.

Amending PREREQ_RUN in pre-local.mk works, but only with
$(JW_PKG_NO_CACHE) == true, or if "undefine JW_PKG_XXX_PATH" is also
added in pre-local.mk. Otherwise JW_PKG_XXX_PATH will not be
recomputed, because it's already defined from the cache.

Introduce the new variable PREREQ_RUN_ADD to solve that. If it's
defined, it automatically invalidates the JW_PKG_XXX_PATH variables
and sets them up for recalculation in py-path.mk / ldlibpath.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:43:11 +02:00
4660a34305
platform.mk: Move include .cache-project.mk up
Reverse inclusion order of .cache-project.mk and cache-projects.mk:
Definitions in .cache-project.mk should win over cache-projects.mk,
because it's the more specialized include file, and the way the
definitions in both files are structured, the later doesn't overwrite
the earlier.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:43:11 +02:00
d31768cbef
projects-dir.mk: Fix: clean-dirs does too much
The clean-dirs target does not only clean the repos present in
PROJECTS, but all repos it finds to be dirty, and clean-all-dirs does
the opposite. I suppose that was an oversight, swap their recipes.

Moreover, cleaning all directories goes about its business in an
overly complicated and unecessarily time-consuming way, fix that,
too.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:43:11 +02:00
fe5756d761
py-defs.mk: Move all path defs into py-path.mk
py-path.mk is the place to host PYTHONPATH and MYPYPATH definitions,
so move them there from py-defs.mk for consistency. Also, remove some
dead code.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:43:11 +02:00
156d073885
py-path|ldlibpath.mk: Space-separate JW_PKG_XXX_PATH
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m45s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m31s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m10s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m1s
CI / Packaging test (push) Successful in 0s
The following variables contain colons as path-separators:

  - JW_PKG_PYTHON_PATH
  - JW_PKG_EXE_PATH
  - JW_PKG_LD_LIBRARY_PATH

This commit makes them use spaces instead, so they can be  more
easily amended by Makefiles using them. Also define them in a more
uniform way, and use the newly introduced PREREQ_RUN variable to fill
them, which in turn can also be appended to before that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 20:16:29 +02:00
10bde0c05d
topdir.mk: Move PREREQ definition into defs.mk
At present, the PREREQ-variable is effectively only used to detect if
prerequiste packages haven't run "make all" before make is run in a
given package. Also, it's only useful in $(TOPDIR). This commit
splits the variable up into PREREQ_BUILD and PREREQ_RUN, and makes
the variables available in every Makefile of a package by placing
them in defs.mk instead of topdir.mk.

This also fixes a problem that PREREQ was cached before being filled,
hence empty. Which effectively wasn't much of a problem, because it
was basically unused, but still.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 20:16:29 +02:00
8712cbc7b5
cache.mk: Support JW_PKG_NO_CACHE
cache.mk generates .project-cache.mk, and this commit supports
disabling the definitions in the generated cache by setting
JW_PKG_NO_CACHE=true.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 20:16:29 +02:00
3833fb0988
cache-projects.mk: Remove unused ifndef / endif
make/Makefile is responsible to generate $(TOPDIR)/cache-projects.mk.
The variables are taken from .cache-project.mk, with some variables
intentionally omitted, but their ifndef / endif blocks remain in
place. Not harmful but ugly. Make sed range-delete the left-over
blocks entirely.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 20:16:12 +02:00
d689d0b8bd
py-path.mk: Add file
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m22s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m4s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m34s
CI / Packaging test (push) Successful in 0s
Aside from PYTHONPATH, ldlibpath.mk runs jw-pkg.py for determining
other paths, too, which is often unneeded and can impact performance.
Split the PYTHONPATH detection into a dedicated py-path.mk, and
include it from ldlibpath.mk, so it can be used instead where needed.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 20:12:10 +02:00
d57876a620
dev-utils.mk: cat-makefiles: Fix typo
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m25s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m6s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m9s
CI / Packaging test (push) Successful in 0s
The cat-makefiles target generates a Makefile with a syntax error as
first line, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 20:01:42 +02:00
dc4a5f2f2e
py-defs.mk: echo-py: Protect recipe from shell expansion
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m3s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m14s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m13s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m10s
CI / Packaging test (push) Successful in 0s
If make echo-py's output is accidentally subjected to shell
expansion, it can yield surprising results. Protect it from that
happening.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 19:49:53 +02:00
d42040cb7b
py-mod.mk: Support PY_INIT_SUBMODULES
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m3s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m12s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m2s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m21s
CI / Packaging test (push) Successful in 0s
Add support for PY_INIT_SUBMODULES to py-mod.mk. If it is defined in
a Makefile including py-mod.mk, the listed submodules will be added
to __init__.py and thus included in the list of things that can be
imported from a module.

This commit also adds support for --submodules to python-tools.sh for
that to happen.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 19:32:40 +02:00
8f1154892f
py-mod.mk: Extract symbols in __all__
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m1s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m6s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m6s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m1s
CI / Packaging test (push) Successful in 0s
Symbols in the __all__ list of a module marked with "# export"
arent't currently added to __init__.py. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 19:24:49 +02:00
9039dc7e40
python-tools.sh, py-mod.mk: Use --symbol-filter
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m8s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m22s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m14s
CI / Packaging test (push) Successful in 0s
Letting python-tools.sh rewrite symbols is more robust than rewriting
an entire __init__.py with PY_INIT_FILTER in the including Makefile.
The latter can break in non-obvious ways if python-tools.sh changes
__init__.py's format.

Make python-tools.sh support --symbol-filter to remedy that. The
option takes an sed script which should expect a string of two
non-whitespace tokens: The module from which the symbol is imported,
and the name of the symbol in that module. It's output will then be
used as the symbol to be exported from __init__.py.

Also, support the PY_SYMBOL_FILTER variable in py-mod.mk. If it's
defined, it is used for --symbol-filter.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-12 07:33:07 +02:00
c8fc6326cb
py-topdir.mk: Use pythonpath --prefix for mypy_path
Make use of the newly introduced --prefix option to the pythonpath
command, and generate what's subseqently used to fill in mypy_path in
pyproject.toml.

By decoupling it from PYTHONPATH, this commit makes the creation of
mypy_path less involved and easier to understand. It also obviates
the need replace the relatively heavy ldlibpath.mk by the relatively
lightweight projects.mk, thereby enhancing performance.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-11 12:18:37 +02:00
850efda804
py-topdir.mk: Add machinery to generate pyproject.toml
pyproject.toml is currently copied unchanged from conf/topdir to the
toplevel directory. Set up machinery in py-topdir.mk to render it
from a template in conf/templates instead, replacing {mypypath} in
the process.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:52:15 +02:00
9ba6c70dee
py-topdir.mk: Add --config pyproject.toml
ruff tries to recursivley use every config file it finds and stumbles
over a template:

  /usr/bin/ruff check --select TC,FA --fix --unsafe-fixes .
  ruff failed
    Cause: Failed to parse /home/jan/local/src/jw.dev/proj/jw-pkg/conf/templates/pyproject.toml
    Cause: TOML parse error at line 3, column 3
    |
  3 |   {mypypath}
    |   ^
  invalid key-value pair, expected key

Limiting it to the toplevel pyproject.toml by explicitly specifying
--config fixes the behaviour, so that's what this commit does.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:47:06 +02:00
7396794122
conf/templates: Add subdir
Add $(TOPDIR)/conf/templates as a location for templates, i.e. input
files to the CmdCreateFile template rendering command.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:15 +02:00
0b558635a8
py-topdir.mk: Introduce $(PY_CHECK_ROOTS)
Replace variable PY_SRC_ROOT by PY_CHECK_ROOTS. The name PY_SRC_ROOT
was a bad choice, given that it isn't immediately obvious that it a)
can contain multiple root locations to be checked, and that it b)
specifically concerns static type checking.

As of this commit, it's possible to limit the type checking scope
with PY_CHECK_ROOTS as in

  PY_CHECK_ROOTS="src/python/jw/pkg/CmdBase.py src/python/jw/lib" \
    make check

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:15 +02:00
8d174f03bd
project.conf: pkg.requires.suse.release -= python3-pyright
All checks were successful
Standard CI tests / Packaging - Kali Linux (pull_request) Successful in 3m17s
Standard CI tests / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m35s
Standard CI tests / Packaging test - All supported platforms (pull_request) Successful in 0s
Standard CI tests / Packaging - Kali Linux (push) Successful in 3m18s
Standard CI tests / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m19s
Standard CI tests / Packaging test - All supported platforms (push) Successful in 0s
Running pyright in a minimal docker container gives this error:

  $ pyright
  /usr/bin/npm-default: No such file or directory
  Traceback (most recent call last):
    File "/usr/bin/pyright-3.13", line 6, in <module>
      sys.exit(entrypoint())
               ~~~~~~~~~~^^
    File "/usr/lib/python3.13/site-packages/pyright/cli.py", line 31, in entrypoint
      sys.exit(main(sys.argv[1:]))
               ~~~~^^^^^^^^^^^^^^
    File "/usr/lib/python3.13/site-packages/pyright/cli.py", line 18, in main
      return run(*args, **kwargs).returncode
             ~~~^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.13/site-packages/pyright/cli.py", line 22, in run
      pkg_dir = install_pyright(args, quiet=None)
    File "/usr/lib/python3.13/site-packages/pyright/_utils.py", line 69, in install_pyright
      node.run(
      ~~~~~~~~^
          'npm',
          ^^^^^^
      ...<5 lines>...
          stderr=subprocess.PIPE if silent else sys.stderr,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      )
      ^
    File "/usr/lib/python3.13/site-packages/pyright/node.py", line 144, in run
      subprocess.run(node_args, **kwargs),
      ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.13/subprocess.py", line 577, in run
      raise CalledProcessError(retcode, process.args,
                               output=stdout, stderr=stderr)
  subprocess.CalledProcessError: Command '['/usr/bin/npm', 'install', \
  'pyright@1.1.409']' returned non-zero exit status 255.

This means that on openSUSE, python3-pyright tries to pull in
packages from the NPM registry. This increases the CI supply chain
attack surface inacceptably, so remove pyright from the release
prerequisites. That should be enough to remove it from the
prerequisites of target check as well and allow it to succeed.

The pyright check machinery itself remains useful, so keep it in
place for developers who install python3-pyright manually.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 18:46:30 +02:00
ca72c21293
projects-dir.mk: Remove "-l user" in ssh-wrapper.sh
By the time projects-dir.mk is used during onboarding, it's already
cloned, and so is jw-pkg in all its glory. So better use a
ssh-wrapper.sh directly under jw-pkg's version control instead of
plainly generating one with echo some-script-logic > ssh-wrapper.sh.

This has the main benefit of allowing a more elaborate script.  The
one added by this commit removes "-l user" from remotes which have a
standard-user@gitserver form, typically because they differentiate
users via their SSH pubkeys only, and which would deny access if both
-l user and standard-user@ were specified.

ssh-wrapper.sh still needs to be a target which is updated by a
recipe, because the version found in jw-pkg can't be trusted to be
executable during bootstrapping, because "make all" has not run, yet.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-07 12:06:02 +02:00
5d6cd03bb2
topdir.mk: Make git-get-pub rebase onto pub's master
The git-get-pub does not have the same effect as the other git-get-%
targets, and this commit makes it.

The other git-get-% targets run pgit.sh, which rebases the current
branch onto the fetched branch, and git-get-pub doesn't. Since devops
merges contributor forges fast-forward without a merge-commit, the
pub remote's master needs to be the last to be rebased on, because
otherwise it will not allow to force-push the result.

As soon as multiple forges with protected master branches contribute,
fast-forward merging of the master branch will need to be abolished
anyway, and the release machinery will need an overhaul.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-07 08:09:48 +02:00
d76350643d
project.conf: Don't require pyright on Debian
pkg.requires.os.release = python3-pyright breaks CI on Kali Linux. It
is present in the janware repos, but using those would cross a line:
jw-pkg must be buildable from the base repositories alone, so don't make
pyright mandatory for Debian, because that pulls it in for Kali, too.

Ironically, the Debian repo provides it. Which makes it obvious that
we will need another entry in the os cascade for Debian proper to
allow pulling in such packages on Debian.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-04 23:14:49 +02:00
b2f0fe2595
py-topdir.mk: Make pyright optional
Be prepared to not have working pyright. This is necessary, because
the next commit will remove it for Debian.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-04 23:14:49 +02:00
f8ce42fc7c
topdir.mk: Make target all depend on topdir
Target all should create all necessary files in topdir. Currently
they're only needed for static file checks, but they might well be
prerequistes for the build to succeed in the future, so make target
all depend on topdir.

Also, place target all before the block of includes, so that the
execution order is defined in topdir.mk rather than the included
snippets.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-04 23:14:49 +02:00
fdabca79e8
py-topdir.mk: py-format|check-annotation-imports
Add two new targets, basically

  py-check-annotation-imports:
    ruff check --select TC,FA --fix --unsafe-fixes .

  py-format-annotation-imports:
    ruff format --select TC,FA --fix --unsafe-fixes .

They basically import statements merely used for annotation
only during type checking runs:

  if TYPE_CHECKING:
    import AirFrobnicator from frobnication

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-03 17:46:14 +02:00
f1456f1d46
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>
2026-06-02 17:52:07 +02:00
b291710c47
dummy-topdir.mk: Add file
This file can be included from toplevel Makefiles of projects which are part
of a jw-pkg project tree but don't want to provide necessary targets
themselves. The targets in this makefile simply do nothing. Feel free to add
functionality to whatever target seems useful to you.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-01 15:45:10 +02:00
5a1ef45cc0
topdir.mk: Fix: make topdir does only half a job
make topdir doesn't reliably regenerate pyrightconfig.json because of
.SECONDEXPANSION. Adding a second dollar symbol $$(TD_GENERATE_FILES)
solves the problem.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-01 14:33:52 +02:00
c0464c0b76
topdir.mk: Make target format depend on topdir
make format needs the fixer configs, of course, so make it depend on
target topdir.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-01 14:33:52 +02:00