summaryrefslogtreecommitdiff
path: root/wrapper.py
AgeCommit message (Collapse)Author
2024-03-21git_command: unify soft/hard versions with requirements.jsonMike Frysinger
Use the requirements logic in the wrapper to load versions out of the requirements.json file to avoid duplicating them in git_command.py. Change-Id: Ib479049fc54ebc6f52c2c30d1315cf1734ff1990 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/415617 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
2023-03-22Format codebase with black and check formatting in CQGavin Mak
Apply rules set by https://gerrit-review.googlesource.com/c/git-repo/+/362954/ across the codebase and fix any lingering errors caught by flake8. Also check black formatting in run_tests (and CQ). Bug: b/267675342 Change-Id: I972d77649dac351150dcfeb1cd1ad0ea2efc1956 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/363474 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
2022-12-08wrapper: switch to functools.lru_cacheMike Frysinger
No need to implement our own caching logic with newer Python. Change-Id: Idc3243b8e22ff020817b0a4f18c9b86b1222d631 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/354357 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
2022-11-28wrapper.py: Replacing load_module() with exec_module()Daniel Kutik
Fixed "DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead." in wrapper.py. Additionally removed Python 2 code (imp.load_source()). Test: tox Signed-off-by: Daniel Kutik <daniel.kutik@lavawerk.com> Change-Id: Ib7cc19b1c545f6449e034c4b01b582cf6cf4b581 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/353237 Reviewed-by: Mike Frysinger <vapier@google.com>
2021-01-06strip python2-only coding:utf-8 & print_function settingsMike Frysinger
We're committed to Python 3 at this point, so clean up boilerplate. Bug: https://crbug.com/gerrit/10418 Change-Id: Ib1719ba2eb65c53b94881a1a1bf203ddfcaaafed Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/292382 Reviewed-by: Chris Mcdonald <cjmcdonald@google.com> Tested-by: Mike Frysinger <vapier@google.com>
2020-02-12Fix blank line issues reported by flake8David Pursehouse
- E301 expected 1 blank line - E302 expected 2 blank lines - E303 too many blank lines - E305 expected 2 blank lines after class or function definition - E306 expected 1 blank line before a nested definition Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E301,E302,E303,E305,E306 Manually fix issues in project.py caused by misuse of block comments. Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
2019-07-31wrapper: Fix indentation levelDavid Pursehouse
Change-Id: I6bee1771053fd8da9c135ed529c4926b42ee9f87 Signed-off-by: David Pursehouse <dpursehouse@collab.net> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/232792 Reviewed-by: Jonathan Nieder <jrn@google.com>
2019-07-31wrapper: replace usage of deprecated imp module for Python 3David Pursehouse
A warning is emitted DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses Change-Id: I6c5a9e024a9a904e02a24331f615548be3fe5f8e Signed-off-by: David Pursehouse <dpursehouse@collab.net> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/230984 Reviewed-by: Jonathan Nieder <jrn@google.com>
2019-06-13set default file encoding to utf-8Mike Frysinger
There's no reason to support any other encoding in these files. This only affects the files themselves and not streams they open. Bug: https://crbug.com/gerrit/10418 Change-Id: I053cb40cd3666ce5c8a0689b9dd938f24ca765bf
2019-06-13wrapper: drop shebangMike Frysinger
This isn't executable (+x), nor does it have a main func or code that would run if it were. It's simply an imported module like most others in here. Drop the shebang to avoid confusion. Change-Id: I5e2881eb1de5e809a3fa9e8f49220ed797034fb1
2014-01-30Add wrapper moduleConley Owens
This takes the wrapper importing code from main.py and moves it into its own module so that other modules may import it without causing circular imports with main.py. Change-Id: I9402950573933ed6f14ce0bfb600f74f32727705