I have several namespace packages. I followed the outline that is sketched in PEP420 and the docs. They are spread out over a few repositories that sometimes bundle them in a deeper namespace.
Setup
For example we could have the structure below.
Repo1
/ns_example/src/ns/example/__init__.py
/ns_example/setup.py
/ns_another/src/ns/another/__init__.py
/ns_another/setup.py
Repo2
/ns_deep/src/ns/deep/one/__init__.py
/ns_example/setup.py
/ns_deep/src/ns/deep/two/__init__.py
/ns_example/setup.py
In setup.py
I create the different packages. Below I specify the two different cases I have from the example above.
from setuptools import setup, find_namespace_packages
import datetime
setup(
name="ns_example",
version=datetime.datetime.now().strftime('%Y.%m.%d.%H%M'),
description='Namespace example',
packages=find_namespace_packages(where='src', include=['ns.*']),
)
from setuptools import setup, find_namespace_packages
import datetime
setup(
name="ns_deep_one",
version=datetime.datetime.now().strftime('%Y.%m.%d.%H%M'),
description='Namespace example',
packages=find_namespace_packages(where='src', include=['ns.deep.*']),
)
Problem
This all works, and I can install them with pip install ns_example
or pip install ns_deep_one
, but now i want to be able to do pip install ns
which would install all the packages in the namespace. That however does not seem to work. Why?