Commit d52b306f authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

Reland "depot_tools: Move six to depot_tools' .vpython"

This is a reland of 3a98df0b

Original change's description:
> depot_tools: Move six to depot_tools' .vpython
> 
> Bug: 984182
> Change-Id: I34a242c8607624beb0f06a27c563e413dec99790
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1717492
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Reviewed-by: Michael Moss <mmoss@chromium.org>

Bug: 984182
Change-Id: Ibf7034201e65a18f833cf1e7432f81a903a99aae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1732880Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent c5f95c03
......@@ -11,6 +11,7 @@
# vpython specs
/gsutil.vpython recipes
/.vpython recipes
# Extensionless tools we want and support scripts.
/autoninja* recipes
......
python_version: "2.7"
# Used by:
# testing_support/super_mox.py
wheel: <
name: "infra/python/wheels/mox-py2_py3"
version: "version:0.5.3"
>
# Used by:
# gclient.py
# testing_support/super_mox.py
# upload_metrics.py
wheel: <
name: "infra/python/wheels/six-py2_py3"
version: "version:1.12.0"
>
......@@ -5,4 +5,4 @@
base_dir=$(dirname "$0")
PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/cit.py" "$@"
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/cit.py" "$@"
......@@ -9,4 +9,4 @@ setlocal
set PATH=%PATH%;%~dp0
:: Defer control.
python "%~dp0\cit.py" %*
vpython "%~dp0\cit.py" %*
#!/usr/bin/env python
#!/usr/bin/env vpython
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
......@@ -5,4 +5,4 @@
base_dir=$(dirname "$0")
PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/fetch.py" "$@"
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@"
......@@ -12,4 +12,4 @@ call "%~dp0\update_depot_tools.bat"
set PATH=%PATH%;%~dp0
:: Defer control.
python "%~dp0\fetch.py" %*
vpython "%~dp0\fetch.py" %*
#!/usr/bin/env python
#!/usr/bin/env vpython
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
......@@ -19,4 +19,4 @@ if [[ "#grep#fetch#cleanup#diff#setdep#" != *"#$1#"* ]]; then
esac
fi
PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/gclient.py" "$@"
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/gclient.py" "$@"
......@@ -12,4 +12,4 @@ call "%~dp0update_depot_tools.bat" %*
set PATH=%PATH%;%~dp0
:: Defer control.
python "%~dp0gclient.py" %*
vpython "%~dp0gclient.py" %*
#!/usr/bin/env python
#!/usr/bin/env vpython
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......@@ -94,6 +94,7 @@ import platform
import posixpath
import pprint
import re
import six
import sys
import time
......@@ -116,7 +117,6 @@ import subcommand
import subprocess2
import setup_color
from third_party import six
# TODO(crbug.com/953884): Remove this when python3 migration is done.
......
......@@ -5,13 +5,13 @@
import ast
import collections
import logging
import six
import sys
import tokenize
import gclient_utils
from third_party import schema
from third_party import six
if six.PY2:
# We use cStringIO.StringIO because it is equivalent to Py3's io.StringIO.
......
......@@ -15,9 +15,9 @@ gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]"
kernel_name=$(uname -s)
if [ "${kernel_name:0:5}" = "MINGW" ]; then
dir="${0%\\*}"
cmd "/C ${dir}\\python.bat ${dir}\\gclient.py runhooks --spec=$gclient_spec"
vpython "${dir}\\gclient.py" "runhooks" "--spec=$gclient_spec"
else
dir="$(dirname $0)"
PYTHONDONTWRITEBYTECODE=1 exec python "$dir/gclient.py" runhooks --spec="$gclient_spec"
PYTHONDONTWRITEBYTECODE=1 exec vpython "$dir/gclient.py" runhooks --spec="$gclient_spec"
fi
exit $?
#!/usr/bin/env python
#!/usr/bin/env vpython
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
#!/usr/bin/env python
#!/usr/bin/env vpython
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
......@@ -12,8 +12,8 @@ base_dir=$(dirname "$0")
OUTPUT="$(uname | grep 'MINGW')"
MINGW=$?
if [ -e "$base_dir/python.bat" -a $MINGW = 0 ]; then
PYTHONDONTWRITEBYTECODE=1 cmd.exe //c "$base_dir\\python.bat" "$base_dir\\pylint.py" "$@"
if [ $MINGW = 0 ]; then
PYTHONDONTWRITEBYTECODE=1 vpython "$base_dir\\pylint.py" "$@"
else
PYTHONDONTWRITEBYTECODE=1 exec "$base_dir/pylint.py" "$@"
fi
#!/usr/bin/env python
#!/usr/bin/env vpython
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
......@@ -47,9 +47,9 @@ SCRIPT="${SCRIPT-${BASENAME//-/_}.py}"
if [[ $PYTHON_DIRECT = 1 ]]; then
python.exe "$DEPOT_TOOLS\\$SCRIPT" "$@"
else
if [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then
cmd.exe //c "$DEPOT_TOOLS\\python.bat" "$DEPOT_TOOLS\\$SCRIPT" "$@"
if [ $OSTYPE = msys ]; then
PYTHONDONTWRITEBYTECODE=1 vpython "$DEPOT_TOOLS\\$SCRIPT" "$@"
else
exec "$DEPOT_TOOLS/$SCRIPT" "$@"
PYTHONDONTWRITEBYTECODE=1 exec "$DEPOT_TOOLS/$SCRIPT" "$@"
fi
fi
......@@ -311,7 +311,7 @@ def call_gclient(*args, **kwargs):
args: command-line arguments to pass to gclient.
kwargs: keyword arguments to pass to call.
"""
cmd = [sys.executable, '-u', GCLIENT_PATH]
cmd = ['vpython', '-u', GCLIENT_PATH]
cmd.extend(args)
# Disable metrics collection on bots, since it's not supported anyway.
kwargs.setdefault('env', {})['DEPOT_TOOLS_METRICS'] = '0'
......
......@@ -5,4 +5,4 @@
base_dir=$(dirname "$0")
PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/roll_dep.py" "$@"
PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/roll_dep.py" "$@"
......@@ -9,4 +9,4 @@ setlocal
set PATH=%PATH%;%~dp0
:: Defer control.
python "%~dp0\roll_dep.py" %*
vpython "%~dp0\roll_dep.py" %*
#!/usr/bin/env python
#!/usr/bin/env vpython
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
......@@ -13,9 +13,8 @@ import string
import subprocess
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import mox
from third_party.six.moves import StringIO
from six.moves import StringIO
class IsOneOf(mox.Comparator):
......
......@@ -164,7 +164,7 @@ class BotUpdateUnittests(unittest.TestCase):
self.call = MockedCall(self.filesystem)
self.gclient = MockedGclientSync(self.filesystem)
self.call.expect(
(sys.executable, '-u', bot_update.GCLIENT_PATH, 'sync')
('vpython', '-u', bot_update.GCLIENT_PATH, 'sync')
).returns(self.gclient)
self.old_call = getattr(bot_update, 'call')
self.params = copy.deepcopy(self.DEFAULT_PARAMS)
......@@ -187,7 +187,7 @@ class BotUpdateUnittests(unittest.TestCase):
def overrideSetupForWindows(self):
sys.platform = 'win'
self.call.expect(
(sys.executable, '-u', bot_update.GCLIENT_PATH, 'sync')
('vpython', '-u', bot_update.GCLIENT_PATH, 'sync')
).returns(self.gclient)
def testBasic(self):
......@@ -240,7 +240,7 @@ class BotUpdateUnittests(unittest.TestCase):
gclient_sync_cmd = None
for record in self.call.records:
args = record[0]
if args[:4] == (sys.executable, '-u', bot_update.GCLIENT_PATH, 'sync'):
if args[:4] == ('vpython', '-u', bot_update.GCLIENT_PATH, 'sync'):
gclient_sync_cmd = args
self.assertTrue('--break_repo_locks' in gclient_sync_cmd)
......
Copyright (c) 2010-2014 Benjamin Peterson
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
URL: https://pypi.python.org/pypi/six
Version: 1.8.0
License: MIT
License File: LICENSE.txt
Description:
This directory contains the Python six module.
Local Modifications:
None
This diff is collapsed.
#!/usr/bin/env python
#!/usr/bin/env vpython
# Copyright (c) 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from third_party.six.moves import urllib
from third_party.six.moves import input # pylint: disable=redefined-builtin
from six.moves import urllib
from six.moves import input # pylint: disable=redefined-builtin
import metrics_utils
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment