Open craynic opened 6 years ago
Thank you, i will check.
so how is the check?
Sorry, i am busy for now with other tasks.
Code is moved to other repository.
Addsitedir does not help in current case. https://github.com/cloudify-incubator/cloudify-utilities-plugins-sdk/blob/8245d577902d25cae9c246dd3bdd46675de4c675/cloudify_common_sdk/importer.py#L149-L172
We are looking for better solution.
I found it very ugly to do this tricky work. What this package does is to check the init.py when importing EVERY package, If the file does not exist (means it may be a namespaced package), it creates the file. Many problems come with it.
IOError
, and further anImportError
. This makes it failed to import the package, and very hard to debug.usr/lib/python2.7/config
.pycrypto
in my environment. I don't know why.I suggest to use sitedir to import namespaced packages. When calling plugin code, plugin site dirs will be inserted into
PYTHONPATH
in dispatch module, we can just add the two dirs to sitedir in plugin__init__.py
. Python will look for the.pth
files in site dirs and make it possible to import namespaced packages. Example: