jw-pkg/make/py-topdir.mk
Jan Lindemann bf3484c2c9
topdir.mk: Add JW_PKG_TMPL_XXX
Add variables to shorten typical invocations of "jw-pkg project update
--format tmpl", and use them in py-topdir.mk

 JW_PKG_TMPL_SEARCH_PATH
 JW_PKG_TMPL_UPDATE

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-13 23:09:25 +02:00

30 lines
1 KiB
Makefile

include $(JWBDIR)/make/projects.mk
TD_GENERATE_FILES += pyproject.toml
PY_CHECK_EXCLUDE ?=
MYPY_CONFIG_PATH = $(shell $(JW_PKG_PY) --topdir-format relative projects pythonpath --prefix '$$MYPY_CONFIG_FILE_DIR/' $(PROJECT))
MYPY_PATH_DIRECTIVE = mypy_path = "$(MYPY_CONFIG_PATH)"
ifndef PY_CHECK_ROOTS
PY_CHECK_ROOTS = $(wildcard $(TOPDIR)/src $(TOPDIR)/tools)
ifneq ($(wildcard dirs-all.done),)
PY_CHECK_ROOTS += $(wildcard $(TOPDIR)/test)
endif
endif
all:
clean: clean.topdir
clean.topdir: clean.py-check
pyproject.toml:
$(JW_PKG_TMPL_UPDATE) $@ --field mypypath='$(MYPY_PATH_DIRECTIVE)' $(PROJECT) > $@.tmp
mv $@.tmp $@
pyrightconfig.json:
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format unaltered projects create-file --format pyright \
--field base=$(JW_PKG_CONF_BASE_DIR)/project/pyrightconfig-base.json $(addprefix --field include=,$(wildcard src/python tools/python)) $(PROJECT) > $@.tmp
mv $@.tmp $@
include $(JWBDIR)/make/py-check.mk