py-*.mk: Make the Python make modules self-contained #140

Merged
Jan Lindemann merged 3 commits from jan/feature/20261016-py-mk-make-the-python-make-modules-self-contained into master 2026-10-16 09:17:06 +02:00 AGit
Owner

These changes make the py-* makefile modules self-contained, so a hand-rolled Makefile can include std-targets.mk and py-defs.mk without pulling in the rest of jw-pkg's make scaffolding. Each commit removes one hidden dependency, or moves a cheap, generally useful definition into the module that benefits from it:

py-path.mk: Include platform.mk for JW_PKG_PY

py-path.mk invokes $(JW_PKG_PY) to compute JW_PKG_PYTHON_PATH, but does not include the file that defines the variable. Not a problem from inside jw-pkg, but nice to have if you want to include std-targets.mk and py-defs.mk without anything else, so include it.

Also drop a dead debug line in the py-path target.

platform.mk: Define empty, space, comma

The PYTHONPATH export in py-path.mk is built by substituting the spaces of the space-separated JW_PKG_PYTHON_PATH list with colons, using space from defs.mk. Which may not be included if somebody wants to include a bare py-defs.mk, so define it in platform.mk. Not happening in jw-pkg, but nice to have.

py-defs.mk: Define PYTHON_RUNNER

PYTHON_RUNNER is defined in py-run.mk but is more generally useful, e.g. for hand-rolled test Makefiles. It's also a cheap definition. Lift it into py-defs.mk instead.

These changes make the py-* makefile modules self-contained, so a hand-rolled Makefile can include `std-targets.mk` and `py-defs.mk` without pulling in the rest of `jw-pkg`'s make scaffolding. Each commit removes one hidden dependency, or moves a cheap, generally useful definition into the module that benefits from it: #### py-path.mk: Include platform.mk for JW_PKG_PY `py-path.mk` invokes `$(JW_PKG_PY)` to compute `JW_PKG_PYTHON_PATH`, but does not include the file that defines the variable. Not a problem from inside `jw-pkg`, but nice to have if you want to include `std-targets.mk` and `py-defs.mk` without anything else, so include it. Also drop a dead debug line in the `py-path` target. #### platform.mk: Define empty, space, comma The `PYTHONPATH` export in `py-path.mk` is built by substituting the spaces of the space-separated `JW_PKG_PYTHON_PATH` list with colons, using `space` from `defs.mk`. Which may not be included if somebody wants to include a bare `py-defs.mk`, so define it in `platform.mk`. Not happening in `jw-pkg`, but nice to have. #### py-defs.mk: Define PYTHON_RUNNER `PYTHON_RUNNER` is defined in `py-run.mk` but is more generally useful, e.g. for hand-rolled test Makefiles. It's also a cheap definition. Lift it into `py-defs.mk` instead.
py-path.mk invokes $(JW_PKG_PY) to compute JW_PKG_PYTHON_PATH, but does not
include the file that defines the variable. Not a problem from inside
jw-pkg, but nice to have if you want to include std-targets.mk and
py-defs.mk without anything else, so include it.

Also drop a dead debug line in the py-path target.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
Signed-off-by: Jan Lindemann <jan@janware.com>
The PYTHONPATH export in py-path.mk is built by substituting the spaces of
the space-separated JW_PKG_PYTHON_PATH list with colons, using "space" from
defs.mk. Which may not be included if somebody wants to include a bare
py-defs.mk, so define it in platform.mk. Not happening in jw-pkg, but nice
to have.

Signed-off-by: Jan Lindemann <jan@janware.com>
py-defs.mk: Define PYTHON_RUNNER
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m15s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m35s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m18s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m54s
CI / Packaging test (push) Successful in 0s
85ddd44cd1
PYTHON_RUNNER is defined in py-run.mk but is more generally useful, e.g.
for hand-rolled test Makefiles. It's also a cheap definition. Lift it into
py-defs.mk instead.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-10-16 09:08:13 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!140
No description provided.