Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: ensure_dependencies.py

Issue 29501558: Issue 5383 - Add tests for the Chrome and Firefox packagers (Closed)
Patch Set: Adjusting tests to recent changes Created Oct. 11, 2017, 4:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # This Source Code Form is subject to the terms of the Mozilla Public 3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 6
7 import sys 7 import sys
8 import os 8 import os
9 import posixpath 9 import posixpath
10 import re 10 import re
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 if level == 0: 337 if level == 0:
338 logging.warning('No dependencies file in directory %s, nothing to do ...\n%s' % (repodir, USAGE)) 338 logging.warning('No dependencies file in directory %s, nothing to do ...\n%s' % (repodir, USAGE))
339 return 339 return
340 if level >= 10: 340 if level >= 10:
341 logging.warning('Too much subrepository nesting, ignoring %s' % repo) 341 logging.warning('Too much subrepository nesting, ignoring %s' % repo)
342 return 342 return
343 343
344 if overrideroots is not None: 344 if overrideroots is not None:
345 config['_root'] = overrideroots 345 config['_root'] = overrideroots
346 346
347 # F823
348 vcs = None
kzar 2017/10/16 11:17:24 What's the idea with this change? The vcs variable
tlucas 2017/10/17 12:45:40 The change below change this to be an F823 flake8
349
347 for dir, sources in sorted(config.iteritems()): 350 for dir, sources in sorted(config.iteritems()):
348 if (dir.startswith('_') or 351 if (dir.startswith('_') or
349 skipdependencies.intersection([s[0] for s in sources if s[0]])): 352 skipdependencies.intersection([s[0] for s in sources if s[0]])):
350 continue 353 continue
351 354
352 target = safe_join(repodir, dir) 355 target = safe_join(repodir, dir)
353 parenttype = get_repo_type(repodir) 356 parenttype = get_repo_type(repodir)
354 _root = config.get('_root', {}) 357 _root = config.get('_root', {})
355 358
356 for key in sources.keys() + _root.keys(): 359 for key in sources.keys() + _root.keys():
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 for l in file_content: 410 for l in file_content:
408 print >>f, l 411 print >>f, l
409 412
410 413
411 if __name__ == '__main__': 414 if __name__ == '__main__':
412 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) 415 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
413 416
414 parser = argparse.ArgumentParser(description='Verify dependencies for a set of repositories, by default the repository of this script.') 417 parser = argparse.ArgumentParser(description='Verify dependencies for a set of repositories, by default the repository of this script.')
415 parser.add_argument('repos', metavar='repository', type=str, nargs='*', help ='Repository path') 418 parser.add_argument('repos', metavar='repository', type=str, nargs='*', help ='Repository path')
416 parser.add_argument('-q', '--quiet', action='store_true', help='Suppress inf ormational output') 419 parser.add_argument('-q', '--quiet', action='store_true', help='Suppress inf ormational output')
420 parser.add_argument(
421 '--nodejs-only',
422 action='store_true',
423 help='Install Node.js production-only dependencies only'
424 )
417 args = parser.parse_args() 425 args = parser.parse_args()
418 426
419 if args.quiet: 427 if args.quiet:
420 logging.disable(logging.INFO) 428 logging.disable(logging.INFO)
421 429
422 repos = args.repos 430 if args.nodejs_only:
423 if not len(repos): 431 vcs = get_repo_type('.')
kzar 2017/10/16 11:17:24 I wonder why we're assigning vcs here, since we ju
tlucas 2017/10/17 12:45:41 This was merely meant to be temporary. Passing it
424 repos = [os.path.dirname(__file__)] 432 resolve_npm_dependencies('.', vcs)
425 for repo in repos: 433 else:
426 resolve_deps(repo) 434 repos = args.repos
435 if not len(repos):
436 repos = [os.path.dirname(__file__)]
437 for repo in repos:
438 resolve_deps(repo)
OLDNEW

Powered by Google App Engine
This is Rietveld