Use case supported? 2 namespace packages in single source repo with 1 setup.py

The idea of the src directory is to separate “things that should be distributed” from “things that should not”. It is meant to be added to your PYTHONPATH variable to get your package importable while testing - it isn’t supposed to be a namespace package.

I’m pretty sure all you’re after here is more search paths (via PYTHONPATH or updating sys.path at runtime), though tbh I think you’ll be fine putting everything under a top level package. For libs that should be loaded by their own top level name, separate out to a separate repo entirely and treat them like any other dependency.

Namespace packages are only useful where you have multiple packages (sdists/wheels, rather than importable modules) that can be installed/uninstaller independently. I posted some more about this recently in How to best structure a large project into multiple installable packages.

But as I said, I don’t think you want this. Stick to one big package for all your self-contained code, treat libraries as libraries, and use the simplest packaging approach possible.