python-tools.sh, py-mod.mk: Use --symbol-filter #13

Merged
Jan Lindemann merged 1 commit from jan/feature/20260612-python-tools-sh-py-mod-mk-use-symbol-filter into master 2026-06-12 07:39:54 +02:00 AGit

python-tools.sh, py-mod.mk: Use --symbol-filter

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.

#### python-tools.sh, py-mod.mk: Use --symbol-filter 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.
python-tools.sh, py-mod.mk: Use --symbol-filter
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 2m8s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 2m34s
CI / Packaging test (pull_request) Failing after 0s
80248dec88

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>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-06-12 07:20:10 +02:00
Jan Lindemann force-pushed jan/feature/20260612-python-tools-sh-py-mod-mk-use-symbol-filter from 80248dec88
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 2m8s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 2m34s
CI / Packaging test (pull_request) Failing after 0s
to 9039dc7e40
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
2026-06-12 07:33:18 +02:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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!13
No description provided.