Commit graph

4,809 commits

Author SHA1 Message Date
4a6c8ab1d1
lib.ExecContext|.Distro: Ignore stdout_str newline

Ignore newline at the end of Result.stdout_str if only one line of output is wanted from an executed shell command. The output of both uname and mktemp are used wrongly in that regard.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-10 12:55:39 +02:00
9732b48788
lib.Result.__repr__(): Fix binary stdout exception

__repr__() tries to decode binary stdout as string and fails without a backup. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-10 12:55:31 +02:00
812ddaa1b0
lib.Result.__repr__() Fix missing f-qualifier

__repr__() tries to format a variable in an f-string without "f". Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-10 12:55:20 +02:00
ead06831f5
Release 1.0.0-236@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m21s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m28s
CI / Packaging test (push) Successful in 0s
2026-06-09 23:27:22 +00:00
19b00e2597
Release 1.0.0-236@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m14s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m22s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-09 23:09:52 +00:00
0c604621c0
Start version: 1.0.0-236
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-09 23:08:49 +00:00
4b6966c480
pyproject.toml: Add {mypypath}
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m7s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m8s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m12s
CI / Packaging test (push) Successful in 0s

Add a [tool.mypy] section to pyproject.toml with a {mypypath} template variable. The already existing template generation mechanism in py-topdir.mk should fill that in with a path pointing to all Python modules managed by jw-pkg:

[tool.mypy]

{mypypath}
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:52:15 +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
da877c624f
cmds.projects.CmdCreateFile: Add more options
- Add an additional, more generic value that --format understands: "tmpl". If chosen, the template selected by the new option --template-name is rendered by replacing --field key=value pairs.
- This commit also adds the option --quote, which makes the renderer enclose the rendered variable values in double quotes.
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:46:47 +02:00
01be594103
cmds.projects.CmdCreateFile: Support --search-path

Add --search-path to the list of CmdCreateFile's supported options. Its value is split by ":" and subsequently passed to the tmpl_render()'s search_path argument.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:46:27 +02:00
81e71bc5c1
cmds.projects.lib.templates.tmpl_render(): RenderValues

tmpl_render()'s "values" argument currently understands dict[str,str|list[str]]. Enhance that to understand the broader RenderValues type, which also includes Iterable[tuple[str, str]], as produced by argparse.add_argument(action='append').

This commit also adds proper type-checking for the values argument. Before, its type had gone unchecked entirely.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:49 +02:00
841fb8b361
cmds.projects.lib.templates.tmpl_render(): search_path

Add an additional keyword-argument search_path to templates.tmpl_render(). It allows to specifiy a list of directory paths in which a template of a given name can be found. It defaults to [], in which case only the built-in templates are considered. Otherwise file locations are tried first, then the built-in templates.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:15 +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
c0c9148281
cmds.projects.CmdCreateFile: Add subdirs src/python

In order to allow Pyright to check the types provided by dependant repositories without installing them, pyrightconfig.json contains a list of paths to their root directories in "extraPaths". These paths are unusable for Pyright, though: For type checking to work, it needs to be pointed to the "jw" namespace package paths within those repos. This commit achieves that by appending the subdirs src/python and tools/python to them, provided they exist.

TODO: This fix hardcodes the current project directory structure. Better would be a way to customize that via makefiles, where the paths can be more easily customized.

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
c3fafdf039
Release 1.0.0-235@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m28s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m16s
CI / Packaging test (push) Successful in 0s
2026-06-08 23:27:03 +00:00
149620daa3
Release 1.0.0-235@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m23s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m12s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-08 23:10:38 +00:00
03ceefaabd
Start version: 1.0.0-235
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-08 23:09:36 +00:00
3f47abb29a
App.get_libname(): Don't use get_proj_refs()
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m16s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m12s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m17s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m18s
CI / Packaging test (push) Successful in 0s

App.get_projects_refs() is a versatile tool, but what it does isn't obvious. Use the simpler method .get_value() instead for get_libname(), and return None if a project doesn't provide a linkable library.

This is similar to fix aadcdfb5f.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 20:41:37 +02:00
c538447cc5
App.__get_project_refs(): Code beautification

In __get_project_refs():

- Rename variable dep and deps to val and vals, respectively, because that's more what they are values of key-value pairs. In some cases that can represent dependencies, in some case other things.
- Make a scope case distinction a little clearer by mentioning all possible cases in a match / case block
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 20:41:37 +02:00
857efee225
jw-pkg-create-project.sh: Gitignore .cache-project.mk
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m15s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m19s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m20s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m11s
CI / Packaging test (push) Successful in 0s

Add make/.cache-project.mk to default the .gitignore file created by make pkg-init-%.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 20:25:15 +02:00
345364cd85
ci.yaml: test-packaging.yaml@{master-test -> master}
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m16s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m12s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m21s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m12s
CI / Packaging test (push) Successful in 0s

Don't use master-test branch from ci/workflows for test-packaging.yaml, because it might mo away. Use master instead.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 19:43:15 +02:00
00af6a2b37
ci.yaml: enable-email-notifications: true
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m21s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m22s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m17s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m15s
CI / Packaging test (push) Successful in 0s

Add enable-email-notifications: true. This seems to be needed for sending information about failed runs. Apparently it doesn't make it difference if I add it to ci/workflows/.github/workflows/test-packaging.yaml.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 19:14:00 +02:00
ace0e915ec
standard-tests.yaml: Rename to ci.yaml

In another attempt at making CI workflow naming more concise:

- Rename standard-tests.yaml to ci.yaml

Currently the contents of this file covers everything CI-related that happens in the context workflows, so for the time being, naming it ci.yaml is just fitting. And it's going to be shorter in commit message summaries. Should a real need arise, we can always split the file up again.
- Shorten names again, otherwise they don't fit into Forgejo's check-mark-popup. That should be self-explanatory in context:
name: Default CI -> CI
jobs.CI.name: Packaging test - All supported platforms -> Packaging test
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 19:13:59 +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
cb649bc28e
Release 1.0.0-234@suse-tumbleweed/x86_64
All checks were successful
Standard CI tests / Packaging - Kali Linux (push) Successful in 4m14s
Standard CI tests / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m42s
Standard CI tests / Packaging test - All supported platforms (push) Successful in 0s
2026-06-07 11:30:51 +00:00
c3f005d816
Release 1.0.0-234@kali-rolling/amd64
All checks were successful
Standard CI tests / Packaging - Kali Linux (push) Successful in 4m6s
Standard CI tests / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m48s
Standard CI tests / Packaging test - All supported platforms (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-07 10:19:00 +00:00
cb7a06a44b
Start version: 1.0.0-234
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-07 10:17:54 +00: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
57a50381a2
pkg.sh: upload_pkg(): Don't ignore git push errors

After release, pkg.sh pushes the changes to VERSION and HASH upstream. Failures are masked, though, propagate them.

Unclear what motivated masking the error. Tracking that down with git blame leads to build-package.sh, which was inherited from ytools, where the change was introduced 2014 with the trust-inspiring comment:

attempted fix for error during commit of version files in build-package.sh

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-07 09:43:07 +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
255396b5dd
Release 1.0.0-233@suse-tumbleweed/x86_64
All checks were successful
Standard CI tests / Packaging - Kali Linux (push) Successful in 4m7s
Standard CI tests / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m42s
Standard CI tests / Packaging test - All supported platforms (push) Successful in 0s
2026-06-06 23:25:24 +00:00
a14f2b20de
Release 1.0.0-233@kali-rolling/amd64
All checks were successful
Standard CI tests / Packaging - Kali Linux (push) Successful in 3m53s
Standard CI tests / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m45s
Standard CI tests / Packaging test - All supported platforms (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-06 23:09:25 +00:00
ba08c67cab
Start version: 1.0.0-233
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-06 23:08:28 +00:00
3dc452d9b4
lib.init.detect_modules(): Renovate signature
- Remove package_name and package_path from the prototype of detect_modules(). They can and should be deduced from namespace['__name__'] and namespace['__path__'], respectively.
- Make prefix default to None, which signifies "Don't filter by prefix".
- Add an optional extend_namespace parameter, which will make the function append the module's __name__ to its __path__. This defaults to True, thereby adding a side effect to the function. Which is always wanted in the case for all callers of this function.
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-06 23:08:28 +00:00
5ea641dc98
Release 1.0.0-232@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-05 23:09:51 +00:00
cf5dba56fe
Release 1.0.0-232@suse-tumbleweed/x86_64
All checks were successful
Standard CI tests / Packaging test - Kali Linux (push) Successful in 3m57s
Standard CI tests / Packaging test - OpenSUSE Tumbleweed (push) Successful in 3m37s
Standard CI tests / Packaging test - All supported platforms (push) Successful in 0s
2026-06-04 23:26:01 +00:00
1b3fd6472a
Start version: 1.0.0-232 2026-06-04 23:25:13 +00:00
7acf752d62
Release 1.0.0-231@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-04 23:09:36 +00: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
6dfb238364
cmds.projects.CmdCreateFile: Fix double-double quotes

CmdCreateFile creates quotes in- and outside of tmpl_render(), which makes for one too many. Fix that.

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
2a19d27ff7
Release 1.0.0-231@suse-tumbleweed/x86_64
All checks were successful
Standard CI tests / Packaging test - Kali Linux (push) Successful in 3m59s
Standard CI tests / Packaging test - OpenSUSE Tumbleweed (push) Successful in 3m35s
Standard CI tests / Packaging test - All supported platforms (push) Successful in 0s
2026-06-03 23:20:43 +00:00
2a49b6a817
Start version: 1.0.0-231 2026-06-03 23:19:55 +00: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
82101ce4a6
workflows/(build-package.yaml -> standard-tests.yaml)

This commit reorganizes build-package.yaml in several ways:

- Follow name change of the called workflow

The reusable workflow used by build-package.yaml changed name and location, and this commit follows the move. It was located at ci/action-build-package before and has moved to ci/workflows, because what it provides is semantically more of a workflow than an action.

- Limit CI runs

The commit also adds safeguards against too many CI runs. It limits them to PR events opened, re-opened or pushed-to, and to push events hitting branches master, main and release.

- Rename workflow itself to standard-tests.yaml

That name reflects better what it represents: The entry point to janware's standard set of CI tests. All of them happen to run in the context of building and packaging at this point, but that might not be the only standard test this repo chooses to subscribe to in the future, and if so, they will be better off in one file with defined order, so give that file a better umbrella name.
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-03 15:29:22 +02:00
6de8d57d09
Release 1.0.0-230@suse-tumbleweed/x86_64
Some checks failed
build-package.yaml / Release 1.0.0-230@suse-tumbleweed/x86_64 (push) Failing after 0s
2026-06-02 23:22:35 +00:00
ea541cbb92
Start version: 1.0.0-230 2026-06-02 23:21:46 +00:00