Commit Graph

12 Commits (a5f17dd7b3cef04e687c33b69b033b2fecf0919f)

Author SHA1 Message Date
Gavin Mak a5f17dd7b3 Revert "Drop py2 support in recipe modules"
This reverts commit 5819c303f0.

Reason for revert: breaking dart builds

Original change's description:
> Drop py2 support in recipe modules
>
> python3 is the only supported version of python in depot_tools.
>
> Bug: 1475402
> Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Bug: 1475402
Change-Id: I0fef7581835bb25ea7e4f22303eef11e72df9536
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811596
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Gavin Mak 5819c303f0 Drop py2 support in recipe modules
python3 is the only supported version of python in depot_tools.

Bug: 1475402
Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Josip Sokcevic 274ada0567 Reland "Use py3 in gitiles recipe module"
This is a reland of 0faae1c845

Original change's description:
> Use py3 in gitiles recipe module
>
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: chrome_release
> Recipe-Nontrivial-Roll: chromiumos
> Bug: 1289280
> Change-Id: I182f0e7ad1da58c1c707edd15675f6d30c5faed8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3438327
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Bug: 1289280
Change-Id: I9ba63a7cd4fea99c2043fae546c63ef942c82802
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3445785
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic 2721cc95da Revert "Use py3 in gitiles recipe module"
This reverts commit 0faae1c845.

Reason for revert: broke dawn and some chromeos builds

Original change's description:
> Use py3 in gitiles recipe module
>
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: chrome_release
> Recipe-Nontrivial-Roll: chromiumos
> Bug: 1289280
> Change-Id: I182f0e7ad1da58c1c707edd15675f6d30c5faed8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3438327
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Bug: 1289280
Change-Id: I09f2860bac9fbac4c2edb0b77baea3802b077958
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3444000
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Gavin Mak 0faae1c845 Use py3 in gitiles recipe module
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Bug: 1289280
Change-Id: I182f0e7ad1da58c1c707edd15675f6d30c5faed8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3438327
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
3 years ago
Gavin Mak a138f082de Add python3 support to gitiles recipe module
This change omits python3 support for resources/gerrit_client.py

Bug: 1227140
Change-Id: Ibc8d9f1fbd28008959991688ced5818f0188f905
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3012233
Commit-Queue: Anthony Polito <apolito@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
4 years ago
Josip Sokcevic 848a5361d7 Stop using /usr/bin/python directly
Use /usr/bin/env python instead

R=dpranke@google.com

Bug: 1191100
Change-Id: I8de37ea7a02e7236d3bd36d4bae8cf4ffcf75ab9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2780631
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
4 years ago
Marc-Antoine Ruel 8e57b4bc55 python3 improvements
Ran:
  vi $(git grep --name-only iteritems | grep -v third_party)
  vi $(git grep --name-only itervalues | grep -v third_party)
  vi $(git grep --name-only 'print ' | grep -v third_party)

and edited the files quickly with adhoc macros. Then ran in recipes/:
  ./recipes.py test train

There was only a small subset of files that had been updated to use
six.iteritems() and six.itervalues(). Since the dataset size that is
being used in gclient is small (pretty much always below 200 items),
it's better to just switch to .items() right away and take the temporary
performance hit, so that we don't need to come back to rewrite the code.

Recipe-Nontrivial-Roll: build
Bug: 984182
Change-Id: I5faf11486b66b0d73c9098ab0f2ce1b15a45c53e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854900
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
6 years ago
Robert Iannucci a4dec94a1a Add download_archive to gitiles module.
R=phosek@chromium.org, tandrii@chromium.org, vadimsh@chromium.org

Bug: 790650
Change-Id: Ia878004d6983dbbad882ec683da2e0db5e727c66
Reviewed-on: https://chromium-review.googlesource.com/1116073
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Michael Moss b40a45149a Allow specifying alternative "success" codes in gitiles requests.
This is needed in the release recipes because there are times when we
want to check that a file is _not_ there yet (i.e. 404 response).

R=agable@chromium.org, dnj@chromium.org

Change-Id: Iedf646d6c73ebf898e90afd2009840b1e5c5b1ab
Reviewed-on: https://chromium-review.googlesource.com/709916
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Commit-Queue: Michael Moss <mmoss@chromium.org>
8 years ago
Aaron Gable ae895075ab Use doseq=True when re-encoding url query parameters
The query parameters are parsed out of a string using
urlparse.parse_qs, which produces a dictionary whose values
are lists of values.

The query parameters are then stuffed back into a string
using urlencode.urlencode, which uses percent-encoding to
encode lists as literal sequences of brackets and commas,
resulting in parse_qs and urlencode not being inverse
operations.

This change adds the doseq flag to urlencode, thus making
it encode each value from the list of values as a separate
key=value pair, thus making it a true inverse of parse_qs.

R=dnj@chromium.org

Change-Id: Ic4631cc672f9e42ba371306efdda71892d625119
Reviewed-on: https://chromium-review.googlesource.com/575398
Reviewed-by: Daniel Jacques <dnj@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Dan Jacques 9d2b4b235c Move tools/build "url" and "gitiles" modules.
Add "tools/build"'s "url" and "gitiles" recipe modules into
"depot_tools". "gitiles" had an explicit dependency on "depot_tools", so
this formalizes this dependency.

To support "url", we vendor "requests" from "tools/build" into
"depot_tools" for it.

BUG=None
TEST=expectations

Change-Id: I1ba634ae264b5c9d3adee20db3397c83a6c52c45
Reviewed-on: https://chromium-review.googlesource.com/483316
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Daniel Jacques <dnj@chromium.org>
8 years ago