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 <jan@janware.com>
7
make/py-ns-dir.mk
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
include $(JWBDIR)/make/dirs.mk
|
||||
|
||||
all:
|
||||
|
||||
clean: py.clean
|
||||
py.clean:
|
||||
rm -rf __pycache__
|
||||