ansible / ansible-builder

An Ansible execution environment builder
Other
287 stars 93 forks source link

Add support for pip specifier syntax like `pywinrm[credssp]==0.4.3` #671

Closed sbancal closed 2 months ago

sbancal commented 4 months ago

In our project we need to install the pywinrm package. As described on https://pypi.org/project/pywinrm/ , we have added it to requirements.txt with the following syntax:

pywinrm[credssp]==0.4.3

When we run ansible-builder build, we see that this line has been simplified to:

pywinrm==0.4.3

which means that the requests-credssp dependency has been forgotten.

Browsing the ansible-builder's code a bit, we found that it's introspect.py's sanitize_requirements function that does this.

https://github.com/ansible/ansible-builder/blob/167ed5ca8b6f589d2c87d7930d3dab92e82351f8/src/ansible_builder/_target_scripts/introspect.py#L319

Would it be possible to add support for this standard pip syntax ?

kurokobo commented 4 months ago

This may be addressed by https://github.com/ansible/ansible-builder/pull/664 since the syntax is in pep508.

Shrews commented 4 months ago

We expect this to be handled in the 3.1 release.