Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add myria namespace package to package metadata #54

Open
senderista opened this issue Jul 7, 2016 · 3 comments
Open

Add myria namespace package to package metadata #54

senderista opened this issue Jul 7, 2016 · 3 comments
Assignees
Labels

Comments

@senderista
Copy link
Contributor

Currently myria-cluster conflicts with myria-python because both packages define modules in the same root namespace myria. The solution should be for both packages to add the "namespace package" myria to their package metadata: http://setuptools.readthedocs.io/en/latest/setuptools.html#namespace-packages.

This requires that all packages sharing the same "root namespace" separately declare it in setup.py as a "namespace package":

setup(
    # ...
    namespace_packages = ['myria']
)

In the __init__.py corresponding to the namespace package:

__import__('pkg_resources').declare_namespace(__name__)
@senderista senderista added the bug label Jul 7, 2016
@senderista senderista self-assigned this Jul 7, 2016
@BrandonHaynes
Copy link
Member

Fixed in ac641e0

@senderista
Copy link
Contributor Author

I've been trying to verify this fix with my own identical fix in myria-ec2-ansible, but haven't managed to get it working. This suggests that the problem is additional code in myria/__init__.py:

You must NOT include any other code and data in a namespace package’s init.py. Even though it may appear to work during development, or when projects are installed as .egg files, it will not work when the projects are installed using “system” packaging tools – in such cases the init.py files will not be installed, let alone executed.

@BrandonHaynes
Copy link
Member

Removing this may break compatibility with existing code, but I don't see an immediate workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants