From 99a8d9140f76300ebfb6c0f5a1c82c415b90be45 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 28 May 2026 07:34:32 +0200 Subject: [PATCH] py-ns-dir.mk: Add file Add py-ns-dir.mk. It's first intended use is inside the $(TOPDIR)/src/python/jw directories of each package. These are to be treated specially, because they contribute to the same namespace: jw. This is true when installed, which means that no __init__.py should be packaged from that directory, see the guide linked below. And it's also true when not installed, in which case there has to be a path-extending __init__.py in the directory. Normally, it should work without __init__.py in that case, as well, and it does for running Python code with PYTHONPATH pointing to the respective package roots. However, pyright doesn't seem to pull in code scattered over multiple locations without an old-style namespace path-extender, so we're likely going to add (but not install) an __init__.py there. Not sure if it's going to be auto-generated py py-ns-dir.mk or committed to version control, we'll see with more testing. Here's where I have my info from, aside from experiments. https://packaging.python.org/en/latest/guides/packaging-namespace-packages/ Signed-off-by: Jan Lindemann --- make/py-ns-dir.mk | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 make/py-ns-dir.mk diff --git a/make/py-ns-dir.mk b/make/py-ns-dir.mk new file mode 100644 index 00000000..1c69d559 --- /dev/null +++ b/make/py-ns-dir.mk @@ -0,0 +1,7 @@ +include $(JWBDIR)/make/dirs.mk + +all: + +clean: py.clean +py.clean: + rm -rf __pycache__