# HG changeset patch # User Simon Fraser # Date 1531755410 0 # Node ID ab20393418605e9ecacca1844c4edee3ae002878 # Parent 8c423f75eb7723a68179dfe3ba1602b5c4c637d9 Bug 1476003 Update python virtual environment for |mach python-safety| r=davehunt Following the lead from 1473727 and python-test. Differential Revision: https://phabricator.services.mozilla.com/D2158 diff --git a/python/safety/mach_commands.py b/python/safety/mach_commands.py --- a/python/safety/mach_commands.py +++ b/python/safety/mach_commands.py @@ -26,26 +26,25 @@ from mozlog import commandline # , get_ here = os.path.abspath(os.path.dirname(__file__)) @CommandProvider class MachCommands(MachCommandBase): @Command('python-safety', category='testing', description='Run python requirements safety checks') @CommandArgument('--python', + default='2.7', help='Version of Python for Pipenv to use. When given a ' 'Python version, Pipenv will automatically scan your ' 'system for a Python that matches that given version.') def python_safety(self, python=None, **kwargs): self.logger = commandline.setup_logging( "python-safety", {"raw": sys.stdout}) - python = python or self.virtualenv_manager.python_path - self.activate_pipenv(pipfile=os.path.join(here, 'Pipfile'), args=[ - '--python', python], populate=True) + self.activate_pipenv(pipfile=os.path.join(here, 'Pipfile'), python=python, populate=True) pattern = '**/*requirements*.txt' path = mozpath.normsep(os.path.dirname(os.path.dirname(here))) finder = FileFinder(path) files = [os.path.join(path, p) for p, f in finder.find(pattern)] return_code = 0