RBTools 4.1__tar.gz → 5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. {RBTools-4.1 → RBTools-5.0}/PKG-INFO +13 -3
  2. {RBTools-4.1 → RBTools-5.0}/RBTools.egg-info/PKG-INFO +13 -3
  3. {RBTools-4.1 → RBTools-5.0}/RBTools.egg-info/SOURCES.txt +23 -7
  4. RBTools-5.0/RBTools.egg-info/requires.txt +10 -0
  5. {RBTools-4.1 → RBTools-5.0}/rbtools/__init__.py +1 -1
  6. {RBTools-4.1 → RBTools-5.0}/rbtools/api/cache.py +26 -94
  7. {RBTools-4.1 → RBTools-5.0}/rbtools/api/capabilities.py +25 -8
  8. {RBTools-4.1 → RBTools-5.0}/rbtools/api/client.py +18 -3
  9. {RBTools-4.1 → RBTools-5.0}/rbtools/api/request.py +75 -19
  10. {RBTools-4.1 → RBTools-5.0}/rbtools/api/resource.py +165 -96
  11. {RBTools-4.1 → RBTools-5.0}/rbtools/api/tests/base.py +56 -8
  12. {RBTools-4.1 → RBTools-5.0}/rbtools/api/tests/test_capabilities.py +25 -3
  13. {RBTools-4.1 → RBTools-5.0}/rbtools/api/tests/test_http_request.py +1 -1
  14. {RBTools-4.1 → RBTools-5.0}/rbtools/api/tests/test_resource.py +14 -22
  15. {RBTools-4.1 → RBTools-5.0}/rbtools/api/transport/__init__.py +24 -6
  16. {RBTools-4.1 → RBTools-5.0}/rbtools/api/transport/sync.py +42 -8
  17. RBTools-5.0/rbtools/api/utils.py +72 -0
  18. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/__init__.py +15 -35
  19. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/base/registry.py +0 -10
  20. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/base/repository.py +3 -4
  21. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/base/scmclient.py +77 -37
  22. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/bazaar.py +2 -3
  23. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/clearcase.py +623 -609
  24. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/cvs.py +1 -4
  25. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/git.py +93 -20
  26. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/mercurial.py +324 -125
  27. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/perforce.py +128 -5
  28. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/sos.py +1 -4
  29. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/svn.py +90 -52
  30. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/__init__.py +3 -22
  31. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_clearcase.py +56 -62
  32. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_git.py +47 -0
  33. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_mercurial.py +81 -24
  34. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_p4.py +181 -1
  35. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_scmclient_registry.py +17 -70
  36. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_sos.py +1 -2
  37. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_svn.py +148 -7
  38. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tfs.py +0 -4
  39. RBTools-5.0/rbtools/commands/__init__.py +264 -0
  40. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/alias.py +4 -3
  41. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/api_get.py +7 -7
  42. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/attach.py +4 -4
  43. RBTools-5.0/rbtools/commands/base/__init__.py +42 -0
  44. RBTools-4.1/rbtools/commands/__init__.py → RBTools-5.0/rbtools/commands/base/commands.py +467 -538
  45. RBTools-5.0/rbtools/commands/base/errors.py +39 -0
  46. RBTools-5.0/rbtools/commands/base/options.py +210 -0
  47. RBTools-5.0/rbtools/commands/base/output.py +286 -0
  48. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/clearcache.py +2 -2
  49. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/close.py +5 -5
  50. RBTools-4.1/rbtools/commands/conf/rbt-bash-completion → RBTools-5.0/rbtools/commands/conf/completions/bash +1 -1
  51. RBTools-4.1/rbtools/commands/conf/_rbt-zsh-completion → RBTools-5.0/rbtools/commands/conf/completions/zsh +1 -1
  52. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/diff.py +10 -10
  53. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/info.py +4 -4
  54. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/install.py +2 -2
  55. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/land.py +54 -23
  56. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/list_repo_types.py +2 -2
  57. RBTools-5.0/rbtools/commands/login.py +90 -0
  58. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/logout.py +3 -3
  59. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/main.py +33 -26
  60. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/patch.py +161 -49
  61. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/post.py +368 -87
  62. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/publish.py +4 -4
  63. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/review.py +50 -20
  64. RBTools-5.0/rbtools/commands/setup_completion.py +68 -0
  65. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/setup_repo.py +12 -11
  66. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/stamp.py +52 -18
  67. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/status.py +6 -6
  68. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/status_update.py +8 -8
  69. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/tests/test_alias.py +1 -1
  70. RBTools-5.0/rbtools/commands/tests/test_base_output.py +245 -0
  71. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/tests/test_main.py +10 -9
  72. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/tests/test_post.py +2 -2
  73. RBTools-5.0/rbtools/commands/tests/test_setup_completion.py +77 -0
  74. RBTools-5.0/rbtools/config/__init__.py +27 -0
  75. RBTools-5.0/rbtools/config/config.py +742 -0
  76. RBTools-5.0/rbtools/config/errors.py +121 -0
  77. RBTools-5.0/rbtools/config/loader.py +154 -0
  78. RBTools-5.0/rbtools/config/tests/test_config.py +328 -0
  79. RBTools-5.0/rbtools/config/tests/test_loader.py +225 -0
  80. RBTools-5.0/rbtools/deprecation.py +66 -0
  81. {RBTools-4.1 → RBTools-5.0}/rbtools/hooks/common.py +52 -4
  82. {RBTools-4.1 → RBTools-5.0}/rbtools/hooks/git.py +40 -6
  83. {RBTools-4.1 → RBTools-5.0}/rbtools/testing/api/transport.py +31 -6
  84. {RBTools-4.1 → RBTools-5.0}/rbtools/testing/commands.py +111 -37
  85. {RBTools-4.1 → RBTools-5.0}/rbtools/testing/testcase.py +102 -10
  86. {RBTools-4.1 → RBTools-5.0}/rbtools/testing/transport.py +43 -0
  87. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/aliases.py +1 -1
  88. RBTools-5.0/rbtools/utils/browser.py +52 -0
  89. RBTools-5.0/rbtools/utils/checks.py +51 -0
  90. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/diffs.py +2 -7
  91. RBTools-5.0/rbtools/utils/encoding.py +153 -0
  92. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/filesystem.py +51 -78
  93. RBTools-5.0/rbtools/utils/mimetypes.py +232 -0
  94. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/process.py +2 -29
  95. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/repository.py +2 -2
  96. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/review_request.py +83 -241
  97. RBTools-5.0/rbtools/utils/tests/__init__.py +0 -0
  98. RBTools-5.0/rbtools/utils/tests/test_checks.py +20 -0
  99. RBTools-5.0/rbtools/utils/tests/test_encoding.py +119 -0
  100. RBTools-5.0/rbtools/utils/tests/test_mimetypes.py +89 -0
  101. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/tests/test_repository.py +17 -1
  102. RBTools-5.0/rbtools/utils/tests/test_web_login.py +301 -0
  103. RBTools-5.0/rbtools/utils/users.py +201 -0
  104. RBTools-5.0/rbtools/utils/web_login.py +612 -0
  105. RBTools-5.0/setup.cfg +36 -0
  106. {RBTools-4.1 → RBTools-5.0}/setup.py +20 -3
  107. RBTools-4.1/RBTools.egg-info/requires.txt +0 -10
  108. RBTools-4.1/pytest.ini +0 -15
  109. RBTools-4.1/rbtools/api/utils.py +0 -116
  110. RBTools-4.1/rbtools/commands/login.py +0 -50
  111. RBTools-4.1/rbtools/commands/setup_completion.py +0 -117
  112. RBTools-4.1/rbtools/deprecation.py +0 -299
  113. RBTools-4.1/rbtools/tests.py +0 -23
  114. RBTools-4.1/rbtools/utils/checks.py +0 -121
  115. RBTools-4.1/rbtools/utils/encoding.py +0 -55
  116. RBTools-4.1/rbtools/utils/match_score.py +0 -55
  117. RBTools-4.1/rbtools/utils/testbase.py +0 -35
  118. RBTools-4.1/rbtools/utils/tests/test_checks.py +0 -42
  119. RBTools-4.1/rbtools/utils/users.py +0 -99
  120. RBTools-4.1/setup.cfg +0 -22
  121. {RBTools-4.1 → RBTools-5.0}/AUTHORS +0 -0
  122. {RBTools-4.1 → RBTools-5.0}/COPYING +0 -0
  123. {RBTools-4.1 → RBTools-5.0}/INSTALL +0 -0
  124. {RBTools-4.1 → RBTools-5.0}/MANIFEST.in +0 -0
  125. {RBTools-4.1 → RBTools-5.0}/NEWS +0 -0
  126. {RBTools-4.1 → RBTools-5.0}/RBTools.egg-info/dependency_links.txt +0 -0
  127. {RBTools-4.1 → RBTools-5.0}/RBTools.egg-info/entry_points.txt +0 -0
  128. {RBTools-4.1 → RBTools-5.0}/RBTools.egg-info/top_level.txt +0 -0
  129. {RBTools-4.1 → RBTools-5.0}/README.md +0 -0
  130. {RBTools-4.1 → RBTools-5.0}/contrib/P4V/README.md +0 -0
  131. {RBTools-4.1 → RBTools-5.0}/contrib/installers/windows/scripts/get-version.py +0 -0
  132. {RBTools-4.1 → RBTools-5.0}/rbtools/api/__init__.py +0 -0
  133. {RBTools-4.1 → RBTools-5.0}/rbtools/api/decode.py +0 -0
  134. {RBTools-4.1 → RBTools-5.0}/rbtools/api/decorators.py +0 -0
  135. {RBTools-4.1 → RBTools-5.0}/rbtools/api/errors.py +0 -0
  136. {RBTools-4.1 → RBTools-5.0}/rbtools/api/factory.py +0 -0
  137. {RBTools-4.1 → RBTools-5.0}/rbtools/api/tests/__init__.py +0 -0
  138. {RBTools-4.1 → RBTools-5.0}/rbtools/api/tests/test_errors.py +0 -0
  139. {RBTools-4.1 → RBTools-5.0}/rbtools/api/tests/test_factory.py +0 -0
  140. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/base/__init__.py +0 -0
  141. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/base/patch.py +0 -0
  142. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/errors.py +0 -0
  143. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/plastic.py +0 -0
  144. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_base_scmclient.py +0 -0
  145. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_bzr.py +0 -0
  146. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_cvs.py +0 -0
  147. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_plastic.py +0 -0
  148. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_scanning.py +0 -0
  149. {RBTools-4.1 → RBTools-5.0}/rbtools/clients/tests/test_tfs.py +0 -0
  150. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/tests/__init__.py +0 -0
  151. {RBTools-4.1 → RBTools-5.0}/rbtools/commands/tests/test_setup_repo.py +0 -0
  152. {RBTools-4.1/rbtools/diffs → RBTools-5.0/rbtools/config}/tests/__init__.py +0 -0
  153. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/__init__.py +0 -0
  154. {RBTools-4.1/rbtools/helpers → RBTools-5.0/rbtools/diffs/tests}/__init__.py +0 -0
  155. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tests/test_apple_diff_tool.py +0 -0
  156. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tests/test_diff_file_result.py +0 -0
  157. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tests/test_diff_tools_registry.py +0 -0
  158. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tests/test_gnu_diff_tool.py +0 -0
  159. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tests/test_unified_diff_writer.py +0 -0
  160. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/__init__.py +0 -0
  161. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/backends/__init__.py +0 -0
  162. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/backends/apple.py +0 -0
  163. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/backends/gnu.py +0 -0
  164. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/base/__init__.py +0 -0
  165. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/base/diff_file_result.py +0 -0
  166. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/base/diff_tool.py +0 -0
  167. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/errors.py +0 -0
  168. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/tools/registry.py +0 -0
  169. {RBTools-4.1 → RBTools-5.0}/rbtools/diffs/writers.py +0 -0
  170. {RBTools-4.1/rbtools/hooks → RBTools-5.0/rbtools/helpers}/__init__.py +0 -0
  171. {RBTools-4.1 → RBTools-5.0}/rbtools/helpers/hgext.py +0 -0
  172. {RBTools-4.1/rbtools/testing/api → RBTools-5.0/rbtools/hooks}/__init__.py +0 -0
  173. {RBTools-4.1 → RBTools-5.0}/rbtools/testing/__init__.py +0 -0
  174. {RBTools-4.1/rbtools/utils → RBTools-5.0/rbtools/testing/api}/__init__.py +0 -0
  175. {RBTools-4.1 → RBTools-5.0}/rbtools/testing/api/payloads.py +0 -0
  176. {RBTools-4.1/rbtools/utils/tests → RBTools-5.0/rbtools/utils}/__init__.py +0 -0
  177. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/appdirs.py +0 -0
  178. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/commands.py +0 -0
  179. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/console.py +0 -0
  180. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/errors.py +0 -0
  181. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/graphs.py +0 -0
  182. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/source_tree.py +0 -0
  183. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/streams.py +0 -0
  184. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/tests/test_aliases.py +0 -0
  185. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/tests/test_buffered_iterator.py +0 -0
  186. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/tests/test_console.py +0 -0
  187. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/tests/test_filesystem.py +0 -0
  188. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/tests/test_process.py +0 -0
  189. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/tests/test_review_request.py +0 -0
  190. {RBTools-4.1 → RBTools-5.0}/rbtools/utils/tests/test_source_tree.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RBTools
3
- Version: 4.1
3
+ Version: 5.0
4
4
  Summary: Command line tools and API for working with code and document reviews on Review Board
5
5
  Home-page: https://www.reviewboard.org/downloads/rbtools/
6
- Download-URL: https://downloads.reviewboard.org/releases/RBTools/4.1/
6
+ Download-URL: https://downloads.reviewboard.org/releases/RBTools/5.0/
7
7
  Author: Beanbag, Inc.
8
8
  Author-email: reviewboard@googlegroups.com
9
9
  License: MIT
@@ -16,17 +16,27 @@ Classifier: Natural Language :: English
16
16
  Classifier: Operating System :: OS Independent
17
17
  Classifier: Programming Language :: Python
18
18
  Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.7
20
19
  Classifier: Programming Language :: Python :: 3.8
21
20
  Classifier: Programming Language :: Python :: 3.9
22
21
  Classifier: Programming Language :: Python :: 3.10
23
22
  Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
24
  Classifier: Topic :: Software Development
25
25
  Classifier: Topic :: Software Development :: Quality Assurance
26
26
  Requires-Python: >=3.7
27
27
  Description-Content-Type: text/markdown
28
28
  License-File: COPYING
29
29
  License-File: AUTHORS
30
+ Requires-Dist: certifi>=2023.5.7
31
+ Requires-Dist: colorama
32
+ Requires-Dist: housekeeping~=1.1
33
+ Requires-Dist: packaging>=21.3
34
+ Requires-Dist: pydiffx~=1.1.0
35
+ Requires-Dist: texttable
36
+ Requires-Dist: typing_extensions>=4.3.0
37
+ Requires-Dist: tqdm
38
+ Requires-Dist: importlib-metadata>=5.0
39
+ Requires-Dist: importlib-resources>=5.9
30
40
 
31
41
  About RBTools
32
42
  =============
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RBTools
3
- Version: 4.1
3
+ Version: 5.0
4
4
  Summary: Command line tools and API for working with code and document reviews on Review Board
5
5
  Home-page: https://www.reviewboard.org/downloads/rbtools/
6
- Download-URL: https://downloads.reviewboard.org/releases/RBTools/4.1/
6
+ Download-URL: https://downloads.reviewboard.org/releases/RBTools/5.0/
7
7
  Author: Beanbag, Inc.
8
8
  Author-email: reviewboard@googlegroups.com
9
9
  License: MIT
@@ -16,17 +16,27 @@ Classifier: Natural Language :: English
16
16
  Classifier: Operating System :: OS Independent
17
17
  Classifier: Programming Language :: Python
18
18
  Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.7
20
19
  Classifier: Programming Language :: Python :: 3.8
21
20
  Classifier: Programming Language :: Python :: 3.9
22
21
  Classifier: Programming Language :: Python :: 3.10
23
22
  Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
24
  Classifier: Topic :: Software Development
25
25
  Classifier: Topic :: Software Development :: Quality Assurance
26
26
  Requires-Python: >=3.7
27
27
  Description-Content-Type: text/markdown
28
28
  License-File: COPYING
29
29
  License-File: AUTHORS
30
+ Requires-Dist: certifi>=2023.5.7
31
+ Requires-Dist: colorama
32
+ Requires-Dist: housekeeping~=1.1
33
+ Requires-Dist: packaging>=21.3
34
+ Requires-Dist: pydiffx~=1.1.0
35
+ Requires-Dist: texttable
36
+ Requires-Dist: typing_extensions>=4.3.0
37
+ Requires-Dist: tqdm
38
+ Requires-Dist: importlib-metadata>=5.0
39
+ Requires-Dist: importlib-resources>=5.9
30
40
 
31
41
  About RBTools
32
42
  =============
@@ -4,7 +4,6 @@ INSTALL
4
4
  MANIFEST.in
5
5
  NEWS
6
6
  README.md
7
- pytest.ini
8
7
  setup.cfg
9
8
  setup.py
10
9
  RBTools.egg-info/PKG-INFO
@@ -17,7 +16,6 @@ contrib/P4V/README.md
17
16
  contrib/installers/windows/scripts/get-version.py
18
17
  rbtools/__init__.py
19
18
  rbtools/deprecation.py
20
- rbtools/tests.py
21
19
  rbtools/api/__init__.py
22
20
  rbtools/api/cache.py
23
21
  rbtools/api/capabilities.py
@@ -92,13 +90,27 @@ rbtools/commands/setup_repo.py
92
90
  rbtools/commands/stamp.py
93
91
  rbtools/commands/status.py
94
92
  rbtools/commands/status_update.py
95
- rbtools/commands/conf/_rbt-zsh-completion
96
- rbtools/commands/conf/rbt-bash-completion
93
+ rbtools/commands/base/__init__.py
94
+ rbtools/commands/base/commands.py
95
+ rbtools/commands/base/errors.py
96
+ rbtools/commands/base/options.py
97
+ rbtools/commands/base/output.py
98
+ rbtools/commands/conf/completions/bash
99
+ rbtools/commands/conf/completions/zsh
97
100
  rbtools/commands/tests/__init__.py
98
101
  rbtools/commands/tests/test_alias.py
102
+ rbtools/commands/tests/test_base_output.py
99
103
  rbtools/commands/tests/test_main.py
100
104
  rbtools/commands/tests/test_post.py
105
+ rbtools/commands/tests/test_setup_completion.py
101
106
  rbtools/commands/tests/test_setup_repo.py
107
+ rbtools/config/__init__.py
108
+ rbtools/config/config.py
109
+ rbtools/config/errors.py
110
+ rbtools/config/loader.py
111
+ rbtools/config/tests/__init__.py
112
+ rbtools/config/tests/test_config.py
113
+ rbtools/config/tests/test_loader.py
102
114
  rbtools/diffs/__init__.py
103
115
  rbtools/diffs/writers.py
104
116
  rbtools/diffs/tests/__init__.py
@@ -131,6 +143,7 @@ rbtools/testing/api/transport.py
131
143
  rbtools/utils/__init__.py
132
144
  rbtools/utils/aliases.py
133
145
  rbtools/utils/appdirs.py
146
+ rbtools/utils/browser.py
134
147
  rbtools/utils/checks.py
135
148
  rbtools/utils/commands.py
136
149
  rbtools/utils/console.py
@@ -139,21 +152,24 @@ rbtools/utils/encoding.py
139
152
  rbtools/utils/errors.py
140
153
  rbtools/utils/filesystem.py
141
154
  rbtools/utils/graphs.py
142
- rbtools/utils/match_score.py
155
+ rbtools/utils/mimetypes.py
143
156
  rbtools/utils/process.py
144
157
  rbtools/utils/repository.py
145
158
  rbtools/utils/review_request.py
146
159
  rbtools/utils/source_tree.py
147
160
  rbtools/utils/streams.py
148
- rbtools/utils/testbase.py
149
161
  rbtools/utils/users.py
162
+ rbtools/utils/web_login.py
150
163
  rbtools/utils/tests/__init__.py
151
164
  rbtools/utils/tests/test_aliases.py
152
165
  rbtools/utils/tests/test_buffered_iterator.py
153
166
  rbtools/utils/tests/test_checks.py
154
167
  rbtools/utils/tests/test_console.py
168
+ rbtools/utils/tests/test_encoding.py
155
169
  rbtools/utils/tests/test_filesystem.py
170
+ rbtools/utils/tests/test_mimetypes.py
156
171
  rbtools/utils/tests/test_process.py
157
172
  rbtools/utils/tests/test_repository.py
158
173
  rbtools/utils/tests/test_review_request.py
159
- rbtools/utils/tests/test_source_tree.py
174
+ rbtools/utils/tests/test_source_tree.py
175
+ rbtools/utils/tests/test_web_login.py
@@ -0,0 +1,10 @@
1
+ certifi>=2023.5.7
2
+ colorama
3
+ housekeeping~=1.1
4
+ packaging>=21.3
5
+ pydiffx~=1.1.0
6
+ texttable
7
+ typing_extensions>=4.3.0
8
+ tqdm
9
+ importlib-metadata>=5.0
10
+ importlib-resources>=5.9
@@ -10,7 +10,7 @@ Beanbag Tools. They're largely used for packaging purposes.
10
10
  #:
11
11
  #: (Major, Minor, Micro, Patch, alpha/beta/rc/final, Release Number, Released)
12
12
  #:
13
- VERSION = (4, 1, 0, 0, 'final', 0, True)
13
+ VERSION = (5, 0, 0, 0, 'final', 0, True)
14
14
 
15
15
 
16
16
  def get_version_string():
@@ -1,3 +1,7 @@
1
+ """Caching implementation for the RBTools API."""
2
+
3
+ from __future__ import annotations
4
+
1
5
  import contextlib
2
6
  import datetime
3
7
  import json
@@ -8,20 +12,23 @@ import sqlite3
8
12
  import threading
9
13
  from email.message import Message
10
14
  from http.client import HTTPResponse
11
- from typing import Callable, Dict, List, MutableMapping, Optional, Union
15
+ from typing import Dict, List, MutableMapping, Optional, Union
12
16
  from urllib.request import urlopen, Request
13
17
 
14
18
  from rbtools.api.errors import CacheError
15
- from rbtools.deprecation import RemovedInRBTools50Warning
16
19
  from rbtools.utils.appdirs import user_cache_dir
17
20
 
18
21
 
19
- MINIMUM_VERSION = '2.0.14' # Minimum server version to enable the API cache.
22
+ #: The minimum version of Review Board to allow HTTP caching.
23
+ #:
24
+ #: Versions prior to this had broken caching. If this version or older is
25
+ #: encountered, caching will be disabled.
26
+ MINIMUM_VERSION = '2.0.14'
20
27
 
21
28
  _locale_lock = threading.Lock() # Lock for getting / setting locale.
22
29
 
23
30
 
24
- class CacheEntry(object):
31
+ class CacheEntry:
25
32
  """An entry in the API Cache."""
26
33
 
27
34
  DATE_FORMAT = '%Y-%m-%dT%H:%M:%S' # ISO Date format
@@ -121,7 +128,7 @@ class CacheEntry(object):
121
128
  return False
122
129
 
123
130
 
124
- class LiveHTTPResponse(object):
131
+ class LiveHTTPResponse:
125
132
  """An uncached HTTP response that can be read() more than once.
126
133
 
127
134
  This is intended to be API-compatible with an
@@ -141,7 +148,7 @@ class LiveHTTPResponse(object):
141
148
  response (http.client.HTTPResponse):
142
149
  The response from the server.
143
150
  """
144
- self.headers = response.info()
151
+ self.headers = response.headers
145
152
  self.content = response.read()
146
153
  self.status = response.status
147
154
 
@@ -154,22 +161,6 @@ class LiveHTTPResponse(object):
154
161
  """
155
162
  return self.status
156
163
 
157
- def info(self) -> Message:
158
- """Return the headers associated with the response.
159
-
160
- Deprecated:
161
- 4.0:
162
- Deprecated in favor of the :py:attr:`headers` attribute.
163
-
164
- Returns:
165
- email.message.Message:
166
- The response headers.
167
- """
168
- RemovedInRBTools50Warning.warn(
169
- 'LiveHTTPResponse.info() is deprecated and will be removed in '
170
- 'RBTools 5.0. Use LiveHTTPResponse.headers instead.')
171
- return self.headers
172
-
173
164
  def read(self) -> bytes:
174
165
  """Return the content associated with the response.
175
166
 
@@ -179,24 +170,8 @@ class LiveHTTPResponse(object):
179
170
  """
180
171
  return self.content
181
172
 
182
- def getcode(self) -> int:
183
- """Return the associated HTTP response code.
184
173
 
185
- Deprecated:
186
- 4.0:
187
- Deprecated in favor of the :py:attr:`code` attribute.
188
-
189
- Returns:
190
- int:
191
- The HTTP response code.
192
- """
193
- RemovedInRBTools50Warning.warn(
194
- 'LiveHTTPResponseInfo.getcode() is deprecated and will be removed '
195
- 'in RBTools 5.0. Use LiveHTTPResponse.code instead.')
196
- return self.status
197
-
198
-
199
- class CachedHTTPResponse(object):
174
+ class CachedHTTPResponse:
200
175
  """A response returned from the APICache.
201
176
 
202
177
  This is intended to be API-compatible with a urllib response object.
@@ -229,22 +204,6 @@ class CachedHTTPResponse(object):
229
204
  """
230
205
  return self.status
231
206
 
232
- def info(self) -> dict:
233
- """Return the headers associated with the response.
234
-
235
- Deprecated:
236
- 4.0:
237
- Deprecated in favor of the :py:attr:`headers` attribute.
238
-
239
- Returns:
240
- dict:
241
- The cached response headers.
242
- """
243
- RemovedInRBTools50Warning.warn(
244
- 'CachedHTTPResponse.info() is deprecated and will be removed in '
245
- 'RBTools 5.0. Use CachedHTTPResponse.headers instead.')
246
- return self.headers
247
-
248
207
  def read(self) -> bytes:
249
208
  """Return the content associated with the response.
250
209
 
@@ -254,25 +213,8 @@ class CachedHTTPResponse(object):
254
213
  """
255
214
  return self.content
256
215
 
257
- def getcode(self) -> int:
258
- """Return the associated HTTP response code, which is always 200.
259
-
260
- Deprecated:
261
- 4.0:
262
- Deprecated in favor of the :py:attr:`code` attribute.
263
216
 
264
- Returns:
265
- int:
266
- 200, always. This pretends that the response is the successful
267
- result of an HTTP request.
268
- """
269
- RemovedInRBTools50Warning.warn(
270
- 'CachedHTTPResponseInfo.getcode() is deprecated and will be '
271
- 'removed in RBTools 5.0. Use CachedHTTPResponse.code instead.')
272
- return 200
273
-
274
-
275
- class APICache(object):
217
+ class APICache:
276
218
  """An API cache backed by a SQLite database."""
277
219
 
278
220
  # The format for the Expires: header. Requires an English locale.
@@ -289,7 +231,6 @@ class APICache(object):
289
231
  self,
290
232
  create_db_in_memory: bool = False,
291
233
  db_location: Optional[str] = None,
292
- urlopen: Optional[Callable] = None,
293
234
  ) -> None:
294
235
  """Create a new instance of the APICache
295
236
 
@@ -308,19 +249,10 @@ class APICache(object):
308
249
  db_location (str):
309
250
  The filename of the cache database, if using.
310
251
 
311
- urlopen (callable):
312
- The method to call for urlopen. This parameter has been
313
- deprecated.
314
-
315
252
  Raises:
316
253
  CacheError:
317
254
  The database exists but the schema could not be read.
318
255
  """
319
- if urlopen is not None:
320
- RemovedInRBTools50Warning.warn(
321
- 'The urlopen parameter to APICache is deprecated and will be '
322
- 'removed in RBTools 5.0.')
323
-
324
256
  if create_db_in_memory:
325
257
  logging.debug('Creating API cache in memory.')
326
258
 
@@ -368,17 +300,17 @@ class APICache(object):
368
300
  # connect fails. In either case, HTTP requests can still be
369
301
  # made, they will just passed through to the URL opener without
370
302
  # attempting to interact with the API cache.
371
- logging.warn('Could not create or access API cache "%s". Try '
372
- 'running "rbt clear-cache" to clear the HTTP '
373
- 'cache for the API.',
374
- self.cache_path)
303
+ logging.warning(
304
+ 'Could not create or access API cache "%s". Try running '
305
+ '"rbt clear-cache" to clear the HTTP cache for the API.',
306
+ self.cache_path)
375
307
 
376
308
  if self.db is not None:
377
309
  self.db.row_factory = APICache._row_factory
378
310
 
379
311
  def make_request(
380
312
  self,
381
- request: Request
313
+ request: Request,
382
314
  ) -> Union[LiveHTTPResponse, CachedHTTPResponse]:
383
315
  """Perform the specified request.
384
316
 
@@ -417,18 +349,18 @@ class APICache(object):
417
349
 
418
350
  response = LiveHTTPResponse(urlopen(request))
419
351
 
420
- if response.getcode() == 304:
352
+ if response.code == 304:
421
353
  logging.debug('Cached response for HTTP GET %s expired '
422
354
  'and was not modified',
423
355
  request.get_full_url())
424
356
  entry.local_date = datetime.datetime.now()
425
357
  self._save_entry(entry)
426
358
  response = CachedHTTPResponse(entry)
427
- elif 200 <= response.getcode() < 300:
359
+ elif 200 <= response.code < 300:
428
360
  logging.debug('Cached response for HTTP GET %s expired '
429
361
  'and was modified',
430
362
  request.get_full_url())
431
- response_headers = response.info()
363
+ response_headers = response.headers
432
364
  cache_info = self._get_caching_info(request.headers,
433
365
  response_headers)
434
366
 
@@ -460,7 +392,7 @@ class APICache(object):
460
392
  self._delete_entry(entry)
461
393
  else:
462
394
  response = LiveHTTPResponse(urlopen(request))
463
- response_headers = response.info()
395
+ response_headers = response.headers
464
396
 
465
397
  cache_info = self._get_caching_info(request.headers,
466
398
  response_headers)
@@ -524,7 +456,7 @@ class APICache(object):
524
456
  try:
525
457
  # 'setlocale' requires the second parameter to be a 'str'
526
458
  # in both Python 2.x and Python 3+.
527
- locale.setlocale(locale.LC_TIME, str('C'))
459
+ locale.setlocale(locale.LC_TIME, 'C')
528
460
  expires = datetime.datetime.strptime(expires,
529
461
  self.EXPIRES_FORMAT)
530
462
 
@@ -606,7 +538,7 @@ class APICache(object):
606
538
  'max_age': max_age,
607
539
  'etag': etag,
608
540
  'last_modified': last_modified,
609
- 'vary_headers': vary_headers
541
+ 'vary_headers': vary_headers,
610
542
  }
611
543
 
612
544
  def _create_schema(self) -> None:
@@ -1,6 +1,6 @@
1
1
  """Review Board server capability management."""
2
2
 
3
- from typing import Dict
3
+ from typing import Any, Mapping
4
4
 
5
5
 
6
6
  class Capabilities:
@@ -10,11 +10,11 @@ class Capabilities:
10
10
  #:
11
11
  #: Type:
12
12
  #: dict
13
- capabilities: Dict
13
+ capabilities: Mapping
14
14
 
15
15
  def __init__(
16
16
  self,
17
- capabilities: Dict,
17
+ capabilities: Mapping,
18
18
  ) -> None:
19
19
  """Initialize the capabilities information.
20
20
 
@@ -37,17 +37,34 @@ class Capabilities:
37
37
  if the capability is set to ``False`` or is not present in the API
38
38
  capabilities.
39
39
  """
40
+ # If only part of a capability path is specified, we don't want to
41
+ # evaluate to True just because it has contents. We want to only
42
+ # say we have a capability if it is indeed 'True'.
43
+ return self.get_capability(*cap_path) is True
44
+
45
+ def get_capability(self, *cap_path) -> Any:
46
+ """Return the capability at the given path.
47
+
48
+ Version Added:
49
+ 5.0
50
+
51
+ Args:
52
+ *cap_path (tuple of str):
53
+ The keys forming a path to the capability.
54
+
55
+ Returns:
56
+ Any:
57
+ The given capability setting. If not present, this will return
58
+ ``None``.
59
+ """
40
60
  caps = self.capabilities
41
61
 
42
62
  try:
43
63
  for key in cap_path:
44
64
  caps = caps[key]
45
65
 
46
- # If only part of a capability path is specified, we don't want to
47
- # evaluate to True just because it has contents. We want to only
48
- # say we have a capability if it is indeed 'True'.
49
- return caps is True
66
+ return caps
50
67
  except (TypeError, KeyError):
51
68
  # The server either doesn't support the capability, or returned no
52
69
  # capabilities at all.
53
- return False
70
+ return None
@@ -1,7 +1,7 @@
1
1
  from typing import Optional, Type
2
2
  from urllib.parse import urlparse
3
3
 
4
- from rbtools.api.resource import Resource
4
+ from rbtools.api.resource import Resource, RootResource
5
5
  from rbtools.api.transport import Transport
6
6
  from rbtools.api.transport.sync import SyncTransport
7
7
 
@@ -36,6 +36,14 @@ class RBClient:
36
36
  #: Type: str
37
37
  url: str
38
38
 
39
+ #: The optional user agent for the client.
40
+ #:
41
+ #: Version Added:
42
+ #: 5.0
43
+ #:
44
+ #: Type: str
45
+ user_agent: Optional[str]
46
+
39
47
  def __init__(
40
48
  self,
41
49
  url: str,
@@ -58,15 +66,22 @@ class RBClient:
58
66
  **kwargs (dict):
59
67
  Keyword arguments to pass to the transport.
60
68
  """
69
+ transport = transport_cls(url, *args, **kwargs)
70
+
61
71
  self.url = url
62
72
  self.domain = urlparse(url)[1]
63
- self._transport = transport_cls(url, *args, **kwargs)
73
+ self._transport = transport
74
+
75
+ if hasattr(transport, 'server') and hasattr(transport.server, 'agent'):
76
+ self.user_agent = transport.server.agent
77
+ else:
78
+ self.user_agent = None
64
79
 
65
80
  def get_root(
66
81
  self,
67
82
  *args,
68
83
  **kwargs,
69
- ) -> Optional[Resource]:
84
+ ) -> Optional[RootResource]:
70
85
  """Return the root resource of the API.
71
86
 
72
87
  Args: