Re-enabled pydeps check and fix stale pydeps
pydeps check was silently disabled when we migrated to python3 due to
the way it checks if it is running on linux. Fixed the issue and updated
all stale pydeps files
Bug: None
Change-Id: I213eb317601237f957302021699a896d81d95c97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276200
Auto-Submit: Mohamed Heikal <[email protected]>
Reviewed-by: Dirk Pranke <[email protected]>
Reviewed-by: Kouhei Ueno <[email protected]>
Reviewed-by: Andrew Grieve <[email protected]>
Commit-Queue: Mohamed Heikal <[email protected]>
Commit-Queue: Kouhei Ueno <[email protected]>
Owners-Override: Peter Wen <[email protected]>
Cr-Commit-Position: refs/heads/main@{#941667}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 513862a..c495b86 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -3444,7 +3444,7 @@
def _LoadFile(self, path):
"""Returns the list of paths within a .pydeps file relative to //."""
if path not in self._file_cache:
- with open(path) as f:
+ with open(path, encoding='utf-8') as f:
self._file_cache[path] = f.read()
return self._file_cache[path]
@@ -3513,7 +3513,7 @@
env = dict(os.environ)
env['PYTHONDONTWRITEBYTECODE'] = '1'
new_pydeps_data = self._input_api.subprocess.check_output(
- cmd + ' --output ""', shell=True, env=env)
+ cmd + ' --output ""', shell=True, env=env, encoding='utf-8')
new_contents = new_pydeps_data.splitlines()[2:]
if old_contents != new_contents:
return cmd, '\n'.join(difflib.context_diff(old_contents, new_contents))
@@ -3536,7 +3536,7 @@
# This check is for Python dependency lists (.pydeps files), and involves
# paths not only in the PRESUBMIT.py, but also in the .pydeps files. It
# doesn't work on Windows and Mac, so skip it on other platforms.
- if input_api.platform != 'linux2':
+ if not input_api.platform.startswith('linux'):
return []
is_android = _ParseGclientArgs().get('checkout_android', 'false') == 'true'
pydeps_to_check = _ALL_PYDEPS_FILES if is_android else _GENERIC_PYDEPS_FILES