-
Notifications
You must be signed in to change notification settings - Fork 522
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
Guidelines for python requirements #77
Comments
Files identified in the description: If these files are incorrect, please update the |
yes, this is something we have been debating for a long time, ansible-builder has such a feature |
ansible-builder info: https://ansible-builder.readthedocs.io/en/stable/collection_metadata/ ansible-core will never provide a means for automatically installing deps from a file like the above, because the variations are too extensive, but when including a collection in an execution environment, ansible-builder allows for a collection to indicate these deps. |
Thanks, I was not considering automatically installing deps, I was just considering making the ansible collections more accessible to modern Fedora packaging guidelines. The tools for packaging python have come a long way that it has become trivial to maintain them due to PEP621 and such. I just hope we can make ansible collection just as accessible with such a guideline. |
Also, just so that we are on the same page, this refers to dependencies of the controller, not of the environments where the modules are executed on. |
That is correct, packaging of a collection wouldn't want to install target deps anyway, since the collection is installed on a controller, and not on a target. One thing we've talked about before is that collection authors could create a bootstrapping playbook, that could be used to install target deps, if it aligns with the means that the user wants to install said deps. But that would not help with packaging. Target deps, being so disconnected from controller deps, as targets do not even have to be the same OS or OS version, cannot reasonably be handled with an OS package of a collection. |
Controller deps would be only guaranteed for plugins. Modules really should not for 2 reasons, they might/might not execute on the controller and they might/might not be written in python or have non python deps. |
Thanks @LecrisUT and others for the details here.The discussion is happening at ansible-community/community-topics#224 as it's bigger than just a docs update. Closing this issue in favor of the broader discussion issue. Once that discussion comes to consensus, we can open another docs issue with the exact docs needed. |
Summary
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.Issue Type
Documentation Report
Component Name
N/A
Ansible Version
N/A
Configuration
N/A
OS / Environment
N/A
Additional Information
Here is my consideration of possible standards
Using
requirements.txt
Pros
.egg
filesCons
Using python metadata
Pros
build-system.requires
for any build requirements, e.g. inansible-galaxy collection build
and equivalentsproject.dependenceis
for local runtime requirements, i.e. plugin requirementsproject.optional-dependencies.test
, etc. for ansible test. Naming not standardized, but it is not that much of an issueproject.optional-dependencies.local-runner
,project.optional-dependencies.moduleA
, or some other format. For dependencies of running a particular runner or module. Does not have to be standardized, just mentioned as a good practiceCons
setup.py
configuration and they use sensible namespacinggalaxy.yaml
Pros
Cons
This could be expanded though to include:
system_requirements
: for system, packages, library and executable requirementspython_requirements
: for python package requirementsMaybe we could use a similar format like PEP621 to separate them logically by usage
In documentation
Pros
Cons
Code of Conduct
The text was updated successfully, but these errors were encountered: