-
Notifications
You must be signed in to change notification settings - Fork 47
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
Undeclared depedency when using OpenStack provider #452
Comments
Could we solve this issue? |
Yes, it can be solved; just need to make the module that imports openstack.py only do it on demand; essentially, make it a lazily loaded module. |
Oh, so |
zaza only "needs" these dependencies when running on an OpenStack provider, as part of a clean-up, which it shouldn't really need to do. However, the world is a messy place. It would not be particularly good to make zaza have actual OpenStack dependencies as this would mean that these modules would have to be installed when testing on just K8s, or AWS or even just locally. Ideally, the openstack provider and all associated functionality would be in a namespaced, separate, submodule that could be 'plugged in' as required. That module would have the OpenStack python modules as dependencies, so that when the OpenStack provider module is required for a particular test, its dependencies would already be available, and zaza would have no particular knowledge about OpenStack, MaaS, etc. However, we are not there, yet. Thus, to solve this tactically, the best way would be to just make the imports lazy on demand so that if OpenStack is never used as a provider then the modules are never attempted to be imported and this error won't occur. |
I see your point here and I agree that those dependencies would not make sense for k8s or AWS, ... . The 'plug in' should be nice, but also a bit complicated. What do you think about using optional dependencies in setup.py ...
openstack_require = [
"python-openstackclient"
]
...
extras_require={
'testing': tests_require,
'openstack': openstack_require,
},
... tox.ini (in charm project) ...
[testenv:func]
deps =
git+https://github.com/openstack-charmers/zaza.git#egg=zaza[openstack]
... |
Commit 4cccbdc introduces a dependency on python-novaclient and python-keystoneclient but zaza itself does not depend on those packages. This breaks charms like grafana which are using zaza to test on openstack but do not include these OpenStack client modules in their dependencies.
Failure from grafana test run:
The text was updated successfully, but these errors were encountered: