adds extra_options arg for pip_install* methods, deprecates injection via packages #1965
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes
Adds a new argument,
extra_options: str
, to theImage
methods that wrappip install
. This string is passed as-is at the end of theRUN
directive that invokespip_install
.Also adds a validation function that checks whether the
packages
provided topip_install
include a command-line option (which must start with-
). Raises a deprecation warning if so. Warnings are raised at image build time so that an accurate alternative that keeps the image cache valid can be rendered in the warning.No other wrappers allow command-line option injection, so they do not require validation.
Internal design doc here.
Backward/forward compatibility checks
I confirmed that the suggested command in the deprecation warning does in fact avoid a rebuild with the following test:
Changelog
Adds an
extra_options
argument topip_install
and related methods ofmodal.Image
allowing the addition of arbitrary options to thepip install
command