From 8a2cd02ac755b12da2368d93fe990c43728fb247 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 26 May 2026 13:56:57 +0200 Subject: [PATCH] py-defs.mk / py-rules.mk: install py.typed If $(wildcard py.typed) is found in a python module directory, install it. py.typed should be used by every repo that declares properly typed code, for jw-pkg that would be at the jw.pkg node, i.e installed to /jw/jw-pkg/py.typed. Signed-off-by: Jan Lindemann --- make/py-defs.mk | 3 ++- make/py-rules.mk | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/make/py-defs.mk b/make/py-defs.mk index 3161af36..f8509fa5 100644 --- a/make/py-defs.mk +++ b/make/py-defs.mk @@ -63,11 +63,12 @@ endif PY_INSTALL_DIRS ?= $(sort $(PY_INSTALL_DIR_PY) $(PY_INSTALL_DIR_PYC)) PY_INSTALLED_PY = $(addprefix $(PY_INSTALL_DIR_PY)/,$(sort $(PY_ALL_PY))) +PY_INSTALLED_PY_TYPED = $(addprefix $(PY_INSTALL_DIR_PY)/,$(wildcard py.typed)) ifeq ($(PY_INSTALL_PYC),true) PY_INSTALLED_PYC = $(addprefix $(PY_INSTALL_DIR_PY)/,$(PY_PYC)) endif ifeq ($(PY_INSTALL_REG),true) - PY_INSTALLED_REG = $(PY_INSTALLED_PY) $(PY_INSTALLED_PYC) + PY_INSTALLED_REG = $(PY_INSTALLED_PY) $(PY_INSTALLED_PYC) $(PY_INSTALLED_PY_TYPED) endif ifeq ($(origin PYTHONPATH),undefined) diff --git a/make/py-rules.mk b/make/py-rules.mk index aaa8f3d0..ce6f16a3 100644 --- a/make/py-rules.mk +++ b/make/py-rules.mk @@ -31,3 +31,6 @@ endif check: $(PY_MYPY) $(shell /bin/bash $(JWB_SCRIPT_DIR)/scm.sh ls-files | grep '\.py$$') + +$(PY_INSTALL_DIR_PY)/py.typed: py.typed + $(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@