I am wondering what is the right / easiest / most pythonic way to deal with the subprojects you want to use with the same base package. Currently we have the following file structure:
trunk\ proj1\setup.py company_name\__init__.py + proj1 code proj2\setup.py company_name\__init__.py + proj2 code
We want the company_name namespace name to be common to all of our projects (maybe this alone doesnβt work), but when proj1 and proj2 are installed in development mode, the first one installed is broken. It looks like import company_name... confused about which company_name package will look in and it captures first / last / random.
How is this usually handled in a larger python project? Is it possible to resolve this with setup.py in the trunk, which creates a kind of mega-egg? I did not find any relevant information about google or the stack, so any information, even just links, is greatly appreciated!
edit: I just tried adding setup.py to the root folder using
... namespace_packages = ['company_name'], package_dir = {'company_name' : ['proj1/company_name', 'proj2/company_name']} ...
with the corresponding pkg_resources.declare_namespace(__name__) in the __init_.py files, but ./setup.py bdist_egg just gives:
error in setup_name command: Distribution does not contain modules or packages for namespace package 'company_name'
python package setuptools project
Per fagrell
source share