It might not be the solution for you, but I tell what we do.
- Prefix the package names, and using namespaces (eg.
company.product.tool
). - When we install our packages (including their in-house dependencies), we use a
requirements.txt
file including our PyPI URL. We run everything in container(s) and we install all public dependencies in them when we are building the images.