Add a --no-pip-check
option to ansible-test.
This commit is contained in:
parent
0971a0e7bc
commit
ee50792416
4 changed files with 19 additions and 8 deletions
2
changelogs/fragments/ansible-test-no-pip-check.yml
Normal file
2
changelogs/fragments/ansible-test-no-pip-check.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- "ansible-test - added a ``--no-pip-check`` option"
|
|
@ -643,6 +643,12 @@ def add_environments(parser, isolated_delegation=True):
|
|||
default=None,
|
||||
help='path to the docker or remote python interpreter')
|
||||
|
||||
parser.add_argument('--no-pip-check',
|
||||
dest='pip_check',
|
||||
default=True,
|
||||
action='store_false',
|
||||
help='do not run "pip check" to verify requirements')
|
||||
|
||||
environments = parser.add_mutually_exclusive_group()
|
||||
|
||||
environments.add_argument('--local',
|
||||
|
|
|
@ -80,6 +80,8 @@ class EnvironmentConfig(CommonConfig):
|
|||
self.python_version = self.python or actual_major_minor
|
||||
self.python_interpreter = args.python_interpreter
|
||||
|
||||
self.pip_check = args.pip_check
|
||||
|
||||
self.delegate = self.docker or self.remote or self.venv
|
||||
self.delegate_args = [] # type: t.List[str]
|
||||
|
||||
|
|
|
@ -237,14 +237,15 @@ def install_command_requirements(args, python_version=None):
|
|||
raise ApplicationError('Conflicts detected in requirements. The following commands reported changes during verification:\n%s' %
|
||||
'\n'.join((' '.join(cmd_quote(c) for c in cmd) for cmd in changes)))
|
||||
|
||||
# ask pip to check for conflicts between installed packages
|
||||
try:
|
||||
run_command(args, pip + ['check', '--disable-pip-version-check'], capture=True)
|
||||
except SubprocessError as ex:
|
||||
if ex.stderr.strip() == 'ERROR: unknown command "check"':
|
||||
display.warning('Cannot check pip requirements for conflicts because "pip check" is not supported.')
|
||||
else:
|
||||
raise
|
||||
if args.pip_check:
|
||||
# ask pip to check for conflicts between installed packages
|
||||
try:
|
||||
run_command(args, pip + ['check', '--disable-pip-version-check'], capture=True)
|
||||
except SubprocessError as ex:
|
||||
if ex.stderr.strip() == 'ERROR: unknown command "check"':
|
||||
display.warning('Cannot check pip requirements for conflicts because "pip check" is not supported.')
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
def run_pip_commands(args, pip, commands, detect_pip_changes=False):
|
||||
|
|
Loading…
Reference in a new issue