python-tools.sh, py-mod.mk: Use --symbol-filter #13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260612-python-tools-sh-py-mod-mk-use-symbol-filter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
80248dec889039dc7e40