networkx / networkx-metis

NetworkX Addon to allow graph partitioning with METIS
Other
79 stars 21 forks source link

Fix circular import #18

Closed OrkoHunter closed 9 years ago

OrkoHunter commented 9 years ago

This includes the changes sent in to travis-test branch by @chebee7i .

@ysitu I think I'm clear now about the presence of __init__.py in networkx/addons/metis/. It is necessary. See, networkx and networkx-metis are sharing the common namespace networkx.addons. So, in both the directories there should be an __init__.py containing the line

__import__('pkg_resources').declare_namespace(__name__)

and nothing else. This establishes their relation of sharing a namespace. Any other package in future also needs the same configuration.

Now, if networkx and networkx-metis are both installed in the system, networkx.addons is a package but networkx.addons.metis is not because of the absence of __init__.py. So, that's why we need it.

I'll create a test branch shortly with current master setup and this fix_circular_import. We can try installing that branch.