Skip to content
Permalink
Browse files
feat!: migrate to use microgen (#52)
* feat!: migrate to use microgen

* chore: update code

* chore: lint
  • Loading branch information
arithmetic1728 committed Sep 29, 2020
1 parent 886a007 commit cf3d35306c3a8f6d32cc7ce1eb436c965acc30fe
Showing with 67,081 additions and 68,165 deletions.
  1. +6 −7 .coveragerc
  2. +43 −0 .kokoro/populate-secrets.sh
  3. +13 −37 .kokoro/release/common.cfg
  4. +10 −5 .kokoro/trampoline.sh
  5. +0 −19 CONTRIBUTING.rst
  6. +4 −2 README.rst
  7. +162 −0 UPGRADING.md
  8. +1 −0 docs/UPGRADING.md
  9. +1 −0 docs/conf.py
  10. +0 −6 docs/gapic/v1/api.rst
  11. +0 −5 docs/gapic/v1/types.rst
  12. +0 −6 docs/gapic/v1p2beta1/api.rst
  13. +0 −5 docs/gapic/v1p2beta1/types.rst
  14. +0 −6 docs/gapic/v1p3beta1/api.rst
  15. +0 −5 docs/gapic/v1p3beta1/types.rst
  16. +0 −6 docs/gapic/v1p4beta1/api.rst
  17. +0 −5 docs/gapic/v1p4beta1/types.rst
  18. +19 −9 docs/index.rst
  19. +9 −0 docs/vision_v1/services.rst
  20. +5 −0 docs/vision_v1/types.rst
  21. +6 −0 docs/vision_v1p2beta1/services.rst
  22. +5 −0 docs/vision_v1p2beta1/types.rst
  23. +9 −0 docs/vision_v1p3beta1/services.rst
  24. +5 −0 docs/vision_v1p3beta1/types.rst
  25. +9 −0 docs/vision_v1p4beta1/services.rst
  26. +5 −0 docs/vision_v1p4beta1/types.rst
  27. +222 −0 google/cloud/vision/__init__.py
  28. +2 −0 google/cloud/vision/py.typed
  29. +31 −27 google/cloud/vision_helpers/__init__.py
  30. +22 −9 google/cloud/vision_helpers/decorators.py
  31. +174 −30 google/cloud/vision_v1/__init__.py
  32. 0 google/cloud/vision_v1/gapic/__init__.py
  33. +0 −255 google/cloud/vision_v1/gapic/enums.py
  34. +0 −599 google/cloud/vision_v1/gapic/image_annotator_client.py
  35. +0 −52 google/cloud/vision_v1/gapic/image_annotator_client_config.py
  36. +0 −2,026 google/cloud/vision_v1/gapic/product_search_client.py
  37. +0 −137 google/cloud/vision_v1/gapic/product_search_client_config.py
  38. 0 google/cloud/vision_v1/gapic/transports/__init__.py
  39. +0 −194 google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py
  40. +0 −510 google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py
  41. 0 google/cloud/vision_v1/proto/__init__.py
  42. +0 −373 google/cloud/vision_v1/proto/geometry_pb2.py
  43. +0 −3 google/cloud/vision_v1/proto/geometry_pb2_grpc.py
  44. +0 −5,188 google/cloud/vision_v1/proto/image_annotator_pb2.py
  45. +0 −243 google/cloud/vision_v1/proto/image_annotator_pb2_grpc.py
  46. +0 −655 google/cloud/vision_v1/proto/product_search_pb2.py
  47. +0 −3 google/cloud/vision_v1/proto/product_search_pb2_grpc.py
  48. +0 −3,368 google/cloud/vision_v1/proto/product_search_service_pb2.py
  49. +0 −1,055 google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py
  50. +0 −1,224 google/cloud/vision_v1/proto/text_annotation_pb2.py
  51. +0 −3 google/cloud/vision_v1/proto/text_annotation_pb2_grpc.py
  52. +0 −629 google/cloud/vision_v1/proto/web_detection_pb2.py
  53. +0 −3 google/cloud/vision_v1/proto/web_detection_pb2_grpc.py
  54. +2 −0 google/cloud/vision_v1/py.typed
  55. +4 −10 google/cloud/{ → vision_v1/services}/__init__.py
  56. +11 −9 google/cloud/{vision.py → vision_v1/services/image_annotator/__init__.py}
  57. +464 −0 google/cloud/vision_v1/services/image_annotator/async_client.py
  58. +604 −0 google/cloud/vision_v1/services/image_annotator/client.py
  59. +36 −0 google/cloud/vision_v1/services/image_annotator/transports/__init__.py
  60. +214 −0 google/cloud/vision_v1/services/image_annotator/transports/base.py
  61. +393 −0 google/cloud/vision_v1/services/image_annotator/transports/grpc.py
  62. +395 −0 google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py
  63. +24 −0 google/cloud/vision_v1/services/product_search/__init__.py
  64. +1,995 −0 google/cloud/vision_v1/services/product_search/async_client.py
  65. +2,093 −0 google/cloud/vision_v1/services/product_search/client.py
  66. +546 −0 google/cloud/vision_v1/services/product_search/pagers.py
  67. +36 −0 google/cloud/vision_v1/services/product_search/transports/__init__.py
  68. +565 −0 google/cloud/vision_v1/services/product_search/transports/base.py
  69. +954 −0 google/cloud/vision_v1/services/product_search/transports/grpc.py
  70. +970 −0 google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py
  71. +0 −74 google/cloud/vision_v1/types.py
  72. +195 −0 google/cloud/vision_v1/types/__init__.py
  73. +100 −0 google/cloud/vision_v1/types/geometry.py
  74. +1,266 −0 google/cloud/vision_v1/types/image_annotator.py
  75. +185 −0 google/cloud/vision_v1/types/product_search.py
  76. +891 −0 google/cloud/vision_v1/types/product_search_service.py
  77. +320 −0 google/cloud/vision_v1/types/text_annotation.py
  78. +163 −0 google/cloud/vision_v1/types/web_detection.py
  79. +71 −24 google/cloud/vision_v1p1beta1/__init__.py
  80. 0 google/cloud/vision_v1p1beta1/gapic/__init__.py
  81. +0 −204 google/cloud/vision_v1p1beta1/gapic/enums.py
  82. +0 −247 google/cloud/vision_v1p1beta1/gapic/image_annotator_client.py
  83. +0 −37 google/cloud/vision_v1p1beta1/gapic/image_annotator_client_config.py
  84. 0 google/cloud/vision_v1p1beta1/gapic/transports/__init__.py
  85. +0 −126 google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py
  86. 0 google/cloud/vision_v1p1beta1/proto/__init__.py
  87. +0 −269 google/cloud/vision_v1p1beta1/proto/geometry_pb2.py
  88. +0 −3 google/cloud/vision_v1p1beta1/proto/geometry_pb2_grpc.py
  89. +0 −3,178 google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py
  90. +0 −89 google/cloud/vision_v1p1beta1/proto/image_annotator_pb2_grpc.py
  91. +0 −161 google/cloud/vision_v1p1beta1/proto/product_search.proto
  92. +0 −825 google/cloud/vision_v1p1beta1/proto/product_search_service.proto
  93. +0 −1,221 google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py
  94. +0 −3 google/cloud/vision_v1p1beta1/proto/text_annotation_pb2_grpc.py
  95. +0 −628 google/cloud/vision_v1p1beta1/proto/web_detection_pb2.py
  96. +0 −3 google/cloud/vision_v1p1beta1/proto/web_detection_pb2_grpc.py
  97. +2 −0 google/cloud/vision_v1p1beta1/py.typed
  98. +5 −11 google/{ → cloud/vision_v1p1beta1/services}/__init__.py
  99. +24 −0 google/cloud/vision_v1p1beta1/services/image_annotator/__init__.py
  100. +188 −0 google/cloud/vision_v1p1beta1/services/image_annotator/async_client.py
  101. +333 −0 google/cloud/vision_v1p1beta1/services/image_annotator/client.py
  102. +36 −0 google/cloud/vision_v1p1beta1/services/image_annotator/transports/__init__.py
  103. +138 −0 google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py
  104. +266 −0 google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc.py
  105. +266 −0 google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc_asyncio.py
  106. +0 −62 google/cloud/vision_v1p1beta1/types.py
  107. +89 −0 google/cloud/vision_v1p1beta1/types/__init__.py
  108. +77 −0 google/cloud/vision_v1p1beta1/types/geometry.py
  109. +735 −0 google/cloud/vision_v1p1beta1/types/image_annotator.py
  110. +305 −0 google/cloud/vision_v1p1beta1/types/text_annotation.py
  111. +161 −0 google/cloud/vision_v1p1beta1/types/web_detection.py
  112. +95 −24 google/cloud/vision_v1p2beta1/__init__.py
  113. 0 google/cloud/vision_v1p2beta1/gapic/__init__.py
  114. +0 −228 google/cloud/vision_v1p2beta1/gapic/enums.py
  115. +0 −330 google/cloud/vision_v1p2beta1/gapic/image_annotator_client.py
  116. +0 −42 google/cloud/vision_v1p2beta1/gapic/image_annotator_client_config.py
  117. 0 google/cloud/vision_v1p2beta1/gapic/transports/__init__.py
  118. +0 −152 google/cloud/vision_v1p2beta1/gapic/transports/image_annotator_grpc_transport.py
  119. 0 google/cloud/vision_v1p2beta1/proto/__init__.py
  120. +0 −369 google/cloud/vision_v1p2beta1/proto/geometry_pb2.py
  121. +0 −3 google/cloud/vision_v1p2beta1/proto/geometry_pb2_grpc.py
  122. +0 −4,175 google/cloud/vision_v1p2beta1/proto/image_annotator_pb2.py
  123. +0 −141 google/cloud/vision_v1p2beta1/proto/image_annotator_pb2_grpc.py
  124. +0 −161 google/cloud/vision_v1p2beta1/proto/product_search.proto
  125. +0 −825 google/cloud/vision_v1p2beta1/proto/product_search_service.proto
  126. +0 −1,224 google/cloud/vision_v1p2beta1/proto/text_annotation_pb2.py
  127. +0 −3 google/cloud/vision_v1p2beta1/proto/text_annotation_pb2_grpc.py
  128. +0 −628 google/cloud/vision_v1p2beta1/proto/web_detection_pb2.py
  129. +0 −3 google/cloud/vision_v1p2beta1/proto/web_detection_pb2_grpc.py
  130. +2 −0 google/cloud/vision_v1p2beta1/py.typed
  131. +16 −0 google/cloud/vision_v1p2beta1/services/__init__.py
  132. +24 −0 google/cloud/vision_v1p2beta1/services/image_annotator/__init__.py
  133. +280 −0 google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py
  134. +424 −0 google/cloud/vision_v1p2beta1/services/image_annotator/client.py
  135. +36 −0 google/cloud/vision_v1p2beta1/services/image_annotator/transports/__init__.py
  136. +167 −0 google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py
  137. +318 −0 google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py
  138. +319 −0 google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py
  139. +0 −66 google/cloud/vision_v1p2beta1/types.py
  140. +113 −0 google/cloud/vision_v1p2beta1/types/__init__.py
  141. +100 −0 google/cloud/vision_v1p2beta1/types/geometry.py
  142. +983 −0 google/cloud/vision_v1p2beta1/types/image_annotator.py
  143. +320 −0 google/cloud/vision_v1p2beta1/types/text_annotation.py
  144. +161 −0 google/cloud/vision_v1p2beta1/types/web_detection.py
  145. +166 −30 google/cloud/vision_v1p3beta1/__init__.py
  146. 0 google/cloud/vision_v1p3beta1/gapic/__init__.py
  147. +0 −285 google/cloud/vision_v1p3beta1/gapic/enums.py
  148. +0 −331 google/cloud/vision_v1p3beta1/gapic/image_annotator_client.py
  149. +0 −52 google/cloud/vision_v1p3beta1/gapic/image_annotator_client_config.py
  150. +0 −1,908 google/cloud/vision_v1p3beta1/gapic/product_search_client.py
  151. +0 −132 google/cloud/vision_v1p3beta1/gapic/product_search_client_config.py
  152. 0 google/cloud/vision_v1p3beta1/gapic/transports/__init__.py
  153. +0 −152 google/cloud/vision_v1p3beta1/gapic/transports/image_annotator_grpc_transport.py
  154. +0 −490 google/cloud/vision_v1p3beta1/gapic/transports/product_search_grpc_transport.py
  155. 0 google/cloud/vision_v1p3beta1/proto/__init__.py
  156. +0 −433 google/cloud/vision_v1p3beta1/proto/geometry_pb2.py
  157. +0 −3 google/cloud/vision_v1p3beta1/proto/geometry_pb2_grpc.py
  158. +0 −4,426 google/cloud/vision_v1p3beta1/proto/image_annotator_pb2.py
  159. +0 −141 google/cloud/vision_v1p3beta1/proto/image_annotator_pb2_grpc.py
  160. +0 −753 google/cloud/vision_v1p3beta1/proto/product_search_pb2.py
  161. +0 −3 google/cloud/vision_v1p3beta1/proto/product_search_pb2_grpc.py
  162. +0 −3,133 google/cloud/vision_v1p3beta1/proto/product_search_service_pb2.py
  163. +0 −1,003 google/cloud/vision_v1p3beta1/proto/product_search_service_pb2_grpc.py
  164. +0 −1,224 google/cloud/vision_v1p3beta1/proto/text_annotation_pb2.py
  165. +0 −3 google/cloud/vision_v1p3beta1/proto/text_annotation_pb2_grpc.py
  166. +0 −628 google/cloud/vision_v1p3beta1/proto/web_detection_pb2.py
  167. +0 −3 google/cloud/vision_v1p3beta1/proto/web_detection_pb2_grpc.py
  168. +2 −0 google/cloud/vision_v1p3beta1/py.typed
  169. +16 −0 google/cloud/vision_v1p3beta1/services/__init__.py
  170. +24 −0 google/cloud/vision_v1p3beta1/services/image_annotator/__init__.py
  171. +278 −0 google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py
  172. +424 −0 google/cloud/vision_v1p3beta1/services/image_annotator/client.py
  173. +36 −0 google/cloud/vision_v1p3beta1/services/image_annotator/transports/__init__.py
  174. +165 −0 google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py
  175. +318 −0 google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py
  176. +319 −0 google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py
  177. +24 −0 google/cloud/vision_v1p3beta1/services/product_search/__init__.py
  178. +1,878 −0 google/cloud/vision_v1p3beta1/services/product_search/async_client.py
  179. +1,988 −0 google/cloud/vision_v1p3beta1/services/product_search/client.py
  180. +546 −0 google/cloud/vision_v1p3beta1/services/product_search/pagers.py
  181. +36 −0 google/cloud/vision_v1p3beta1/services/product_search/transports/__init__.py
  182. +537 −0 google/cloud/vision_v1p3beta1/services/product_search/transports/base.py
  183. +922 −0 google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py
  184. +936 −0 google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py
  185. +0 −74 google/cloud/vision_v1p3beta1/types.py
  186. +183 −0 google/cloud/vision_v1p3beta1/types/__init__.py
  187. +117 −0 google/cloud/vision_v1p3beta1/types/geometry.py
  188. +1,039 −0 google/cloud/vision_v1p3beta1/types/image_annotator.py
  189. +203 −0 google/cloud/vision_v1p3beta1/types/product_search.py
  190. +825 −0 google/cloud/vision_v1p3beta1/types/product_search_service.py
  191. +320 −0 google/cloud/vision_v1p3beta1/types/text_annotation.py
  192. +161 −0 google/cloud/vision_v1p3beta1/types/web_detection.py
  193. +180 −30 google/cloud/vision_v1p4beta1/__init__.py
  194. 0 google/cloud/vision_v1p4beta1/gapic/__init__.py
  195. +0 −255 google/cloud/vision_v1p4beta1/gapic/enums.py
  196. +0 −498 google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py
  197. +0 −49 google/cloud/vision_v1p4beta1/gapic/image_annotator_client_config.py
  198. +0 −2,026 google/cloud/vision_v1p4beta1/gapic/product_search_client.py
  199. +0 −137 google/cloud/vision_v1p4beta1/gapic/product_search_client_config.py
  200. 0 google/cloud/vision_v1p4beta1/gapic/transports/__init__.py
  201. +0 −194 google/cloud/vision_v1p4beta1/gapic/transports/image_annotator_grpc_transport.py
  202. +0 −510 google/cloud/vision_v1p4beta1/gapic/transports/product_search_grpc_transport.py
  203. 0 google/cloud/vision_v1p4beta1/proto/__init__.py
  204. +0 −286 google/cloud/vision_v1p4beta1/proto/face_pb2.py
  205. +0 −3 google/cloud/vision_v1p4beta1/proto/face_pb2_grpc.py
  206. +0 −373 google/cloud/vision_v1p4beta1/proto/geometry_pb2.py
  207. +0 −3 google/cloud/vision_v1p4beta1/proto/geometry_pb2_grpc.py
  208. +0 −5,016 google/cloud/vision_v1p4beta1/proto/image_annotator_pb2.py
  209. +0 −243 google/cloud/vision_v1p4beta1/proto/image_annotator_pb2_grpc.py
  210. +0 −654 google/cloud/vision_v1p4beta1/proto/product_search_pb2.py
  211. +0 −3 google/cloud/vision_v1p4beta1/proto/product_search_pb2_grpc.py
  212. +0 −3,367 google/cloud/vision_v1p4beta1/proto/product_search_service_pb2.py
  213. +0 −1,067 google/cloud/vision_v1p4beta1/proto/product_search_service_pb2_grpc.py
  214. +0 −1,224 google/cloud/vision_v1p4beta1/proto/text_annotation_pb2.py
  215. +0 −3 google/cloud/vision_v1p4beta1/proto/text_annotation_pb2_grpc.py
  216. +0 −629 google/cloud/vision_v1p4beta1/proto/web_detection_pb2.py
  217. +0 −3 google/cloud/vision_v1p4beta1/proto/web_detection_pb2_grpc.py
  218. +2 −0 google/cloud/vision_v1p4beta1/py.typed
  219. +16 −0 google/cloud/vision_v1p4beta1/services/__init__.py
  220. +24 −0 google/cloud/vision_v1p4beta1/services/image_annotator/__init__.py
  221. +456 −0 google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py
  222. +604 −0 google/cloud/vision_v1p4beta1/services/image_annotator/client.py
  223. +36 −0 google/cloud/vision_v1p4beta1/services/image_annotator/transports/__init__.py
  224. +206 −0 google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py
  225. +393 −0 google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py
  226. +395 −0 google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py
  227. +24 −0 google/cloud/vision_v1p4beta1/services/product_search/__init__.py
  228. +1,983 −0 google/cloud/vision_v1p4beta1/services/product_search/async_client.py
  229. +2,095 −0 google/cloud/vision_v1p4beta1/services/product_search/client.py
  230. +546 −0 google/cloud/vision_v1p4beta1/services/product_search/pagers.py
  231. +36 −0 google/cloud/vision_v1p4beta1/services/product_search/transports/__init__.py
  232. +549 −0 google/cloud/vision_v1p4beta1/services/product_search/transports/base.py
  233. +956 −0 google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py
  234. +972 −0 google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py
  235. +0 −76 google/cloud/vision_v1p4beta1/types.py
  236. +203 −0 google/cloud/vision_v1p4beta1/types/__init__.py
  237. +79 −0 google/cloud/vision_v1p4beta1/types/face.py
  238. +100 −0 google/cloud/vision_v1p4beta1/types/geometry.py
  239. +1,196 −0 google/cloud/vision_v1p4beta1/types/image_annotator.py
  240. +185 −0 google/cloud/vision_v1p4beta1/types/product_search.py
  241. +891 −0 google/cloud/vision_v1p4beta1/types/product_search_service.py
  242. +320 −0 google/cloud/vision_v1p4beta1/types/text_annotation.py
  243. +163 −0 google/cloud/vision_v1p4beta1/types/web_detection.py
  244. +3 −0 mypy.ini
  245. +4 −2 noxfile.py
  246. +3 −4 samples/snippets/crop_hints/crop_hints.py
  247. +25 −26 samples/snippets/detect/beta_snippets.py
  248. +46 −46 samples/snippets/detect/detect.py
  249. +2 −2 samples/snippets/detect/set_endpoint.py
  250. +3 −4 samples/snippets/detect/vision_async_batch_annotate_images.py
  251. +2 −3 samples/snippets/detect/vision_batch_annotate_files.py
  252. +2 −3 samples/snippets/detect/vision_batch_annotate_files_gcs.py
  253. +1 −2 samples/snippets/document_text/doctext.py
  254. +1 −2 samples/snippets/face_detection/faces.py
  255. +3 −4 samples/snippets/product_search/import_product_sets.py
  256. +7 −7 samples/snippets/product_search/product_in_product_set_management.py
  257. +13 −12 samples/snippets/product_search/product_management.py
  258. +11 −13 samples/snippets/product_search/product_search.py
  259. +7 −11 samples/snippets/product_search/product_set_management.py
  260. +1 −1 samples/snippets/product_search/reference_image_management.py
  261. +1 −2 samples/snippets/quickstart/quickstart.py
  262. +2 −3 samples/snippets/web/web_detect.py
  263. +200 −0 scripts/fixup_vision_v1_keywords.py
  264. +178 −0 scripts/fixup_vision_v1p1beta1_keywords.py
  265. +179 −0 scripts/fixup_vision_v1p2beta1_keywords.py
  266. +197 −0 scripts/fixup_vision_v1p3beta1_keywords.py
  267. +200 −0 scripts/fixup_vision_v1p4beta1_keywords.py
  268. +15 −7 setup.py
  269. +3 −236 synth.metadata
  270. +63 −31 synth.py
  271. +38 −37 tests/system.py
  272. +0 −256 tests/unit/gapic/v1/test_image_annotator_client_v1.py
  273. +0 −895 tests/unit/gapic/v1/test_product_search_client_v1.py
  274. +0 −102 tests/unit/gapic/v1p1beta1/test_image_annotator_client_v1p1beta1.py
  275. +0 −159 tests/unit/gapic/v1p2beta1/test_image_annotator_client_v1p2beta1.py
  276. +0 −151 tests/unit/gapic/v1p3beta1/test_image_annotator_client_v1p3beta1.py
  277. +0 −843 tests/unit/gapic/v1p3beta1/test_product_search_client_v1p3beta1.py
  278. +0 −256 tests/unit/gapic/v1p4beta1/test_image_annotator_client_v1p4beta1.py
  279. +0 −895 tests/unit/gapic/v1p4beta1/test_product_search_client_v1p4beta1.py
  280. +1 −0 tests/unit/gapic/vision_v1/__init__.py
  281. +1,510 −0 tests/unit/gapic/vision_v1/test_image_annotator.py
  282. +5,488 −0 tests/unit/gapic/vision_v1/test_product_search.py
  283. +1 −0 tests/unit/gapic/vision_v1p1beta1/__init__.py
  284. +927 −0 tests/unit/gapic/vision_v1p1beta1/test_image_annotator.py
  285. +1 −0 tests/unit/gapic/vision_v1p2beta1/__init__.py
  286. +1,143 −0 tests/unit/gapic/vision_v1p2beta1/test_image_annotator.py
  287. +1 −0 tests/unit/gapic/vision_v1p3beta1/__init__.py
  288. +1,145 −0 tests/unit/gapic/vision_v1p3beta1/test_image_annotator.py
  289. +5,304 −0 tests/unit/gapic/vision_v1p3beta1/test_product_search.py
  290. +1 −0 tests/unit/gapic/vision_v1p4beta1/__init__.py
  291. +1,513 −0 tests/unit/gapic/vision_v1p4beta1/test_image_annotator.py
  292. +5,490 −0 tests/unit/gapic/vision_v1p4beta1/test_product_search.py
  293. +9 −7 tests/unit/test_decorators.py
  294. +21 −20 tests/unit/test_helpers.py
@@ -21,15 +21,14 @@ branch = True
[report]
fail_under = 100
show_missing = True
omit = google/cloud/vision/__init__.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore abstract methods
raise NotImplementedError
omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
@@ -0,0 +1,43 @@
#!/bin/bash
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -eo pipefail

function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
function msg { println "$*" >&2 ;}
function println { printf '%s\n' "$(now) $*" ;}


# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
mkdir -p ${SECRET_LOCATION}
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
do
msg "Retrieving secret ${key}"
docker run --entrypoint=gcloud \
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
gcr.io/google.com/cloudsdktool/cloud-sdk \
secrets versions access latest \
--project cloud-devrel-kokoro-resources \
--secret ${key} > \
"${SECRET_LOCATION}/${key}"
if [[ $? == 0 ]]; then
msg "Secret written to ${SECRET_LOCATION}/${key}"
else
msg "Error retrieving secret ${key}"
fi
done
@@ -23,42 +23,18 @@ env_vars: {
value: "github/python-vision/.kokoro/release.sh"
}

# Fetch the token needed for reporting release status to GitHub
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "yoshi-automation-github-key"
}
}
}

# Fetch PyPI password
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "google_cloud_pypi_password"
}
}
}

# Fetch magictoken to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "releasetool-magictoken"
}
}
# Fetch PyPI password
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "google_cloud_pypi_password"
}
}
}

# Fetch api key to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "magic-github-proxy-api-key"
}
}
}
# Tokens needed to report release status back to GitHub
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}
@@ -15,9 +15,14 @@

set -eo pipefail

python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" || ret_code=$?
# Always run the cleanup script, regardless of the success of bouncing into
# the container.
function cleanup() {
chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
echo "cleanup";
}
trap cleanup EXIT

chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
${KOKORO_GFILE_DIR}/trampoline_cleanup.sh || true

exit ${ret_code}
$(dirname $0)/populate-secrets.sh # Secret Manager secrets.
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py"
@@ -80,25 +80,6 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.

.. nox: https://pypi.org/project/nox/
Note on Editable Installs / Develop Mode
========================================

- As mentioned previously, using ``setuptools`` in `develop mode`_
or a ``pip`` `editable install`_ is not possible with this
library. This is because this library uses `namespace packages`_.
For context see `Issue #2316`_ and the relevant `PyPA issue`_.

Since ``editable`` / ``develop`` mode can't be used, packages
need to be installed directly. Hence your changes to the source
tree don't get incorporated into the **already installed**
package.

.. _namespace packages: https://www.python.org/dev/peps/pep-0420/
.. _Issue #2316: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2316
.. _PyPA issue: https://github.com/pypa/packaging-problems/issues/12
.. _develop mode: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
.. _editable install: https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs

*****************************************
I'm getting weird errors... Can you help?
*****************************************
@@ -61,11 +61,13 @@ dependencies.

Supported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
Python >= 3.5
Python >= 3.6

Deprecated Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^
Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
Python == 2.7.

The last version of this library compatible with Python 2.7 is google-cloud-vision==1.0.0.

RaspberryPi ARM devices
^^^^^^^^^^^^^^^^^^^^^^^
@@ -0,0 +1,162 @@
# 2.0.0 Migration Guide

The 2.0 release of the `google-cloud-vision` client is a significant upgrade based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-python), and includes substantial interface changes. Existing code written for earlier versions of this library will likely require updates to use this version. This document describes the changes that have been made, and what you need to do to update your usage.

If you experience issues or have questions, please file an [issue](https://github.com/googleapis/python-vision/issues).

## Supported Python Versions

> **WARNING**: Breaking change
The 2.0.0 release requires Python 3.6+.


## Method Calls

> **WARNING**: Breaking change
Methods expect request objects. We provide a script that will convert most common use cases.

* Install the library

```py
python3 -m pip install google-cloud-vision
```

* The script `fixup_vision_v1_keywords.py` is shipped with the library. It expects
an input directory (with the code to convert) and an empty destination directory.

```sh
$ fixup_vision_v1_keywords.py --input-directory .samples/ --output-directory samples/
```

**Before:**
```py
from google.cloud import vision_v1
client = vision_v1.ProductSearchClient()
product_set = client.get_product_set("name")
```


**After:**
```py
from google.cloud import vision_v1
client = vision_v1.ProductSearchClient()
product_set = client.get_product_set(request={"name": "name"})
```

### More Details

In `google-cloud-vision<2.0.0`, parameters required by the API were positional parameters and optional parameters were keyword parameters.

**Before:**
```py
def create_product_set(
self,
parent,
product_set,
product_set_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
```

In the 2.0.0 release, all methods have a single positional parameter `request`. Method docstrings indicate whether a parameter is required or optional.

Some methods have additional keyword only parameters. The available parameters depend on the `google.api.method_signature` annotation specified by the API producer.


**After:**
```py
def create_product_set(
self,
request: product_search_service.CreateProductSetRequest = None,
*,
parent: str = None,
product_set: product_search_service.ProductSet = None,
product_set_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> product_search_service.ProductSet:
```

> **NOTE:** The `request` parameter and flattened keyword parameters for the API are mutually exclusive.
> Passing both will result in an error.

Both of these calls are valid:

```py
response = client.create_product_set(
request={
"parent": parent,
"product_set_id": product_set_id,
"product_set": product_set
}
)
```

```py
response = client.create_product_set(
parent=parent,
product_set_id=product_set_id,
product_set=product_set
)
```

This call is invalid because it mixes `request` with a keyword argument `product_set`. Executing this code
will result in an error.

```py
response = client.create_product_set(
request={
"parent": parent,
"product_set_id": product_set_id
},
product_set=product_set
)
```



## Enums and Types


> **WARNING**: Breaking change
The submodules `enums` and `types` have been removed.

**Before:**
```py
from google.cloud import vision_v1
likelihood = vision_v1.enums.Likelihood.UNKNOWN
request = vision_v1.types.GetProductSetRequest(name="name")
```


**After:**
```py
from google.cloud import vision_v1
likelihood = vision_v1.Likelihood.UNKNOWN
request = vision_v1.GetProductSetRequest(name="name")
```

## Location Path Helper Method

Loation path helper method has been removed. Please construct
the path manually.

```py
project = "my-project"
location = "location"
location_path = f"projects/{project}/locations/{location}"
```
@@ -39,6 +39,7 @@
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit cf3d353

Please sign in to comment.