Add coverage library to vpython3 so that we can have better insight in how we stand wrt our test coverage in depot_tools.

Bug: b/459690822
Change-Id: I17d67e0530755fa9c07bbc4dabf6d81b6a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7244730
Auto-Submit: Alex Ovsienko <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Commit-Queue: Alex Ovsienko <[email protected]>
3 files changed
tree: 6ac3facfce82befebabb7b532dee4c7eee86ac9e
  1. bootstrap/
  2. fetch_configs/
  3. hooks/
  4. infra/
  5. infra_lib/
  6. man/
  7. mcp/
  8. metadata/
  9. python-bin/
  10. python2-bin/
  11. recipes/
  12. testing_support/
  13. tests/
  14. third_party/
  15. win_toolchain/
  16. zsh-goodies/
  17. .cipd_impl.ps1
  18. .flake8
  19. .git-blame-ignore-revs
  20. .gitattributes
  21. .gitignore
  22. .isort.cfg
  23. .style.yapf
  24. .vpython3
  25. android_build_server_helper.py
  26. auth.py
  27. autoninja
  28. autoninja.bat
  29. autoninja.py
  30. bazel.py
  31. bb
  32. bb.bat
  33. black
  34. bootstrap_python3
  35. breakpad.py
  36. BUILD_OWNERS
  37. build_telemetry
  38. build_telemetry.bat
  39. build_telemetry.py
  40. caffeinate.py
  41. cipd
  42. cipd.bat
  43. cipd_bin_setup.bat
  44. cipd_bin_setup.sh
  45. cipd_client_version
  46. cipd_client_version.digests
  47. cipd_manifest.txt
  48. cipd_manifest.versions
  49. cipd_manifest_cros_python2.txt
  50. cipd_manifest_cros_python2.versions
  51. clang-format
  52. clang-format.bat
  53. clang_format.py
  54. codereview.settings
  55. compile_single_file
  56. compile_single_file.bat
  57. compile_single_file.py
  58. cpplint.bat
  59. cpplint.py
  60. cpplint_chromium.py
  61. create_temp_file.py
  62. cros
  63. CROS_OWNERS
  64. cros_python2.vpython
  65. detect_host_arch.py
  66. DIR_METADATA
  67. dirmd
  68. dirmd.bat
  69. download_from_google_storage
  70. download_from_google_storage.bat
  71. download_from_google_storage.py
  72. ensure_bootstrap
  73. fetch
  74. fetch.bat
  75. fetch.py
  76. gclient
  77. gclient-new-workdir.py
  78. gclient.bat
  79. gclient.py
  80. gclient_completion.sh
  81. gclient_eval.py
  82. gclient_paths.py
  83. gclient_scm.py
  84. gclient_utils.py
  85. gerrit_cache.py
  86. gerrit_client.py
  87. gerrit_util.py
  88. git-cache
  89. git-cl
  90. git-credential-luci
  91. git-credential-luci.bat
  92. git-crrev-parse
  93. git-drover
  94. git-find-releases
  95. git-footers
  96. git-freeze
  97. git-gs
  98. git-hyper-blame
  99. git-map
  100. git-map-branches
  101. git-mark-merge-base
  102. git-nav-downstream
  103. git-nav-upstream
  104. git-new-branch
  105. git-number
  106. git-rebase-update
  107. git-rename-branch
  108. git-reparent-branch
  109. git-retry
  110. git-runhooks
  111. git-squash-branch
  112. git-squash-branch-tree
  113. git-thaw
  114. git-upstream-diff
  115. git_auth.py
  116. git_cache.py
  117. git_cl.py
  118. git_cl_completion.sh
  119. git_common.py
  120. git_completion.sh
  121. git_dates.py
  122. git_find_releases.py
  123. git_footers.py
  124. git_freezer.py
  125. git_hyper_blame.py
  126. git_map.py
  127. git_map_branches.py
  128. git_mark_merge_base.py
  129. git_nav_downstream.py
  130. git_new_branch.py
  131. git_number.py
  132. git_rebase_update.py
  133. git_rename_branch.py
  134. git_reparent_branch.py
  135. git_retry.py
  136. git_squash_branch.py
  137. git_squash_branch_tree.py
  138. git_upstream_diff.py
  139. gn
  140. gn.bat
  141. gn.py
  142. gn_helper.py
  143. google-java-format
  144. google-java-format.bat
  145. google_java_format.py
  146. gsutil.py
  147. gsutil.py.bat
  148. gsutil.py.vpython3
  149. isort
  150. led
  151. led.bat
  152. LICENSE
  153. lockfile.py
  154. luci-auth
  155. luci-auth-fido2-plugin.bat
  156. luci-auth-ssh-helper
  157. luci-auth-ssh-helper.bat
  158. luci-auth-ssh-plugin
  159. luci-auth-ssh-plugin.bat
  160. luci-auth.bat
  161. luci_auth_fido2_plugin.py
  162. LUCI_OWNERS
  163. lucicfg
  164. lucicfg.bat
  165. mac_toolchain
  166. metrics-xml-format
  167. metrics.py
  168. metrics.README.md
  169. metrics_utils.py
  170. metrics_xml_format.py
  171. my_activity.py
  172. newauth.py
  173. ninja
  174. ninja.bat
  175. ninja.py
  176. ninjalog_uploader.py
  177. OWNERS
  178. owners_client.py
  179. owners_finder.py
  180. pinpoint
  181. pinpoint.bat
  182. post_build_ninja_summary.py
  183. PRESUBMIT.py
  184. presubmit_canned_checks.py
  185. presubmit_diff.py
  186. presubmit_support.py
  187. prpc
  188. prpc.bat
  189. pylint-2.17
  190. pylint-2.17.bat
  191. pylint-2.6
  192. pylint-2.6.bat
  193. pylint-2.7
  194. pylint-2.7.bat
  195. pylint-3.2
  196. pylint-3.2.bat
  197. pylint_main.py
  198. pylintrc-2.17
  199. pylintrc-2.6
  200. pylintrc-2.7
  201. pylintrc-3.2
  202. pyproject.toml
  203. python_runner.sh
  204. rdb
  205. rdb.bat
  206. rdb_wrapper.py
  207. README.gclient.md
  208. README.git-cl.md
  209. README.google_cloud_storage.md
  210. README.md
  211. reclient_helper.py
  212. RECLIENT_OWNERS
  213. reclientreport
  214. reclientreport.bat
  215. reclientreport.py
  216. repo
  217. repo_launcher
  218. roll-dep
  219. roll-dep.bat
  220. roll_dep.py
  221. roll_downstream_gcs_deps.py
  222. rustfmt.py
  223. scm.py
  224. setup_color.py
  225. siso
  226. siso.bat
  227. siso.py
  228. split_cl.py
  229. subcommand.py
  230. subprocess2.py
  231. swift-format
  232. swift_format.py
  233. update_depot_tools
  234. update_depot_tools.bat
  235. update_depot_tools_toggle.py
  236. upload_metrics.py
  237. upload_to_google_storage.py
  238. upload_to_google_storage_first_class.py
  239. utils.py
  240. vpython3
  241. vpython3.bat
  242. WATCHLISTS
  243. watchlists.py
  244. whitespace.txt
  245. win32imports.py
  246. yapf
  247. yapf.bat
README.md

depot_tools

Tools for Chromium development. Requires Python 3.8+.

gsutil: Python 3.9–3.13 required.

Tools

The most important tools are:

  • fetch: A gclient wrapper to checkout a project. Use fetch --help for more details.
  • gclient: A meta-checkout tool. Think repo or git submodules, except that it support OS-specific rules, e.g. do not checkout Windows only dependencies when checking out for Android. Use gclient help for more details and README.gclient.md.
  • git cl: A code review tool to interact with Rietveld or Gerrit. Use git cl help for more details and README.git-cl.md.
  • roll-dep: A gclient dependency management tool to submit a dep roll, updating a dependency to a newer revision.

There are a lot of git utilities included.

Also, includes shell script/batch file for tools required to build chromium, e.g.

  • gn: a meta-build system that generates build files for Ninja
  • autoninja: a wrapper for siso and ninja.
  • siso: a build tool that aims to significantly speed up Chromium's build.
  • ninja: a small build system with a focus on speed. deprecated by Siso.

These shell script/batch file runs python script with python-bin/python3 that find binaries in chromium checkout, and run with proper setup/check. To use these wrappers, you need to initialize/bootstrap depot_tools (using gclient, update_depot_tools or ensure_bootstrap).

Installing

See set-up documentation.

depot_tools is also available in

These depot_tools would not be initialized/bootstrapped (i.e. no python-bin/python3 binary available), so the build tool wrapper won't work, unless it is explicitly initialized by ensure_bootstrap. Or, directly call the python script instead of using the shell script/batch file.

Updating

depot_tools updates itself automatically when running gclient tool. To disable auto update, set the environment variable DEPOT_TOOLS_UPDATE=0 or run ./update_depot_tools_toggle.py --disable.

To update package manually, run update_depot_tools.bat on Windows, or ./update_depot_tools on Linux or Mac.

Running gclient will install python3 binary.

Contributing

To contribute change for review:

git new-branch <somename>
# Hack
git add .
git commit -a -m "Fixes goat teleporting"
# find reviewers
git cl owners
git log -- <yourfiles>

# Request a review.
git cl upload -r [email protected],[email protected] --send-mail

# Edit change description if needed.
git cl desc

# If change is approved, flag it to be committed.
git cl set-commit

# If change needs more work.
git rebase-update
...
git cl upload -t "Fixes goat teleporter destination to be Australia"

See also open bugs, open reviews, forum or report problems.

cpplint.py

Until 2018, our cpplint.py was a copy of the upstream version at https://github.com/google/styleguide/tree/gh-pages/cpplint. Unfortunately, that repository is not maintained any more. If you want to update cpplint.py in depot_tools, just upload a patch to do so. We will figure out a long-term strategy via issue https://crbug.com/916550.