Making it easier to get submodules

So I had a slight hiccup the other day when I tried to contribute to ansible. I have contributed in the past, but it was before the ansible modules were split out into separate “core” and “extras” git repos.

So when I tried to run the tests, I was missing the proper git submodules.

My attempt at making this easier for people who want to contribute:

https://github.com/ansible/ansible/pull/9597

Serge raised some concerns about it possibly hurting some other workflows, which I hopefully handled, but it would be good to get more eyes on it.

To be honest, I’m not sure that hacking/env-setup is the right place to add this, but this is pirobably because in my ideal world, there would be no hacking/env-setup in the first place. I would love to just create a virtualenv and do pip install -e .. Last time I tried this, it didn’t work because ansible was installing modules globally in /usr/share and such. But I noticed that there were a lot of changes in how stuff is organized since then, so it might be possible now out of the box or perhaps with a little work. If that were true, then I wouldn’t need hacking/env-setup, but I would still need something to initialize the git submodules. So perhaps there’s some other place where that can be done?

Marc

Marc,

Can you post this on the ansible-devel list?

Thanks,

James

Honestly, I don’t like the change. For me env-setup is not meant to setup ansible itself, it is just a shortcut to setting the environment vars to run Ansible from a git clone.

If you are running from source and using env-setup you should know how to handle the submodules.

This would actually break my work flow, since I am typically using this for developing ansible itself (including modules). As such I don’t typically have the submodules cloned. I have an extra step in my work flow to fetch and merge the module repos into my own and add their paths to ANSIBLE_LIBRARY (this env var is set using postactivate from virtualenvwrappers).

I think fixing pip -e would be a good place to start. It largely does work but there are some PYTHONPATH issues that still linger. See https://github.com/ansible/ansible/issues/7092

I not sure with -e, but pip typically handles the submodule stuff itself without issues.