When packaging an ansible collection/role, there currently is no standard way of specifying python requirements, primarily the hard requirements of plugins. Some people use requirements.txt, but there is no standard guidelines for role and collection authors that I could find. It would be nice to have this documented and discussed somewhere.
This discussion started in this community-topic but stalled a bit I think. Please read that and then let’s continue the discussion here - how do we move forward on this one?
I would presume that requirements.txt and bindep.txt should go in the root of a collection tree (same dir as galaxy.yml), so that they can be picked up by ansible-builder during EE builds.
It would also be nice if ansible-galaxy and maybe some other ansible tools could validate python/system requirements whenever those *.txt files are present in collections. Then warn/fail when dependencies are missing. It would definitely be cool if there was a parameter/switch for auto-installing missing dependencies (if bindep/pip are available in $PATH at least). For e.g. AWX’s dynamic collection install feature works great for collections, but it doesn’t install missing dependencies. I’m not sure how feasible it would be to enable/allow dynamically updating dependencies in EE’s on the fly like AWX does with collections, but at least getting warnings about missing dependencies might be nice.