Commit graph

6 commits

Author SHA1 Message Date
5d1ba6e15a
pyproject.toml: Enforce import annotations style

Add new ruff rules and fix their fallout:

future-annotations = true

select = [ "TC", # type-checking import placement rules "FA", # future annotations rules ]

This comprises:

- Streamline imports and exports in cmds.xxx.Cmd

- Import base class as "Base"
- Export types Cmd and Parent via __all__

- Move all types imported only for annotation below TYPE_CHECKING

- Use "from __future__ import annotations" all over the place

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-01 14:34:25 +02:00
24928c6f5d
cmds / lib: Fix more static checker findings

Fix more errors and warnings produced by "make check" as reported by CI and a pyright upgrade.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-01 07:55:11 +02:00
3b65bcabb8
cmds.projects.CmdCreatePkgConfig: Use tmpl_render()

Use tmpl_render() to render the file template. Better for centralized template definition.

The commit also applies style fixes to CmdCreatePkgConfig which anticipate broader style changes to jw-pkg in general.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-31 18:19:39 +02:00
9c06103a4a cmds.project.*: Make _run() async

Cmd._run(), as conceived for working with lib.App, is meant to be an async method. To be conservative about changes, jw-pkg's legacy way of handling _run() was kept when deriving from libApp, and async was not propagated down to the _run() implementations. This commit rectifies that before adding additional subcommands.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 17:41:10 +01:00
f175f9d5c9 lib.Cmd: Add argument "parent" to __init__()

During __init__(), commands have no idea of their parent. This is not a problem as of now, but is easy to fix, and it's architecturally desirable to be prepared just in case, so add the parent argument to the ctor before more commands are added.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 15:24:24 +01:00
0b83c863a2 jw.build.cmds: Move build.cmds -> cmds.projects

Reorganize the Python module structure. Placing the command classes under jw.cmds.projects instead of jw.build.cmds will allow to add a nested command structure, with the current commands, being mostly related to building software, found below a "projects" toplevel command.

Other conceivable commands could be "package" for packaging, or "distro" for commands wrapping the distribution's package manager.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
Renamed from src/python/jw/pkg/build/cmds/CmdCreatePkgConfig.py (Browse further)