-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Add support for user and constraints to pip module #33098
Conversation
The test
|
7cb9fb7
to
b208e64
Compare
CI failure in integration tests:
|
Sphinx jobs and reno jobs need basically the same thing for dependencies. So make a new role, ensure-sphinx, which is parameterizable enough that it can be used by both reno and sphinx jobs. Make build jobs for both releasenotes and sphinx docs, as both of these things are perfectly valid things to do in both OpenStack and non-OpenStack contexts. We'll add an openstack specific job in openstack-zuul-jobs that uses these as parents but adds the requirements repo and constraints file settings. Some of the pip commands here can be improved once ansible/ansible#33098 lands and is released, which would allow specifying --user and -c as parameters to the pip module. Change-Id: Idd7caf7d88b56d61872906027b4ce7d743572ded Needed-By: I57de14580f39b9e1c11a587b51b44b61b02c84da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR.
It looks good overall and we should be able to merge it, once the tests are green.
# Once it does/can, change this to verify using req_installed.version instead | ||
# of looking in stdout_lines | ||
- name: check that version of package was installed that we expect | ||
assert: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check should be after the register task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh. Duh. Thanks.
user: yes | ||
|
||
# TODO pip module does not report back version in the return info. | ||
# Once it does/can, change this to verify using req_installed.version instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to implement this :)
It shouldn't be too hard. We already return the version when given as input and the version is available in _is_present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool - I'll do that in a second PR.
b208e64
to
b6368da
Compare
pip supports a --user flag, which tells pip to install to the Python user install directory. Add it as a boolean flag. pip also supports a -c/--constraint option that can be used to supply a file containing constraints to apply to how pip resolves dependencies. Add a parameter allowing a user to provide a path to a constraints file.
b6368da
to
fe0560d
Compare
CI failure in integration tests. Most of the errors appear to be: The RHEL 7.4 failure is unrelated to the PR and should be resolved when CI runs again. |
@emonty The tests are still not green. Can you have another look? |
SUMMARY
pip supports a --user flag, which tells pip to install to the Python
user install directory. Add it as a boolean flag.
pip also supports a -c/--constraint option that can be used to supply a
file containing constraints to apply to how pip resolves dependencies.
Add a parameter allowing a user to provide a path to a constraints file.
ISSUE TYPE
COMPONENT NAME
lib/ansible/modules/packaging/language/pip.py
ADDITIONAL INFORMATION
Both of these can be put into extra_args of course, but it doing so in playbooks where they are optional parameters starts to get really awkward, while having them as parameters allows use of things like default(omit)