You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 13, 2025. It is now read-only.
This is a "catch-all ticket" of things I have identified that need doing in Python auto-gen.
Examples in this ticket will follow Vision (which I have hand-edited).
More important items are marked with ⚠️; this ticket should be demoted to P2 once those are completed.
*_client.py (e.g. image_annotator_client.py)
⚠️ In docstrings, references to string should be spelled str.
⚠️ In docstrings, references to iterator should be spelled Iterable.
Docstrings should use 4-space indents.
Docstring class references should use the ~. prefix if a period is present in the class name.
In docstring examples, use ... for the prompt in hanging indents or continued statements (match the interpreter).
⚠️@landrito The pkg_resources.get_distribution call needs to use the "manual" package name (e.g. google-cloud-vision), not the GAPIC package name. We are moving away from publishing stand-alone GAPIC packages.
Rename to image_annotator_config.py, and write the value to a variable in the top line. Alter the corresponding GAPIC Python file to import this rather than using pkg_resources.resource_string to load the JSON file.
⚠️@landrito Add a versioned directory in the google.cloud namespace (e.g. google.cloud.vision_v1)
⚠️@landrito Add a types.py file to the google.cloud.api_vN package which iterates over all the _pb2.py files in the proto and makes the messages available in a consistent namespace (see Vision for a reference implementation).
⚠️@landrito Add an __init__.py file to the google.cloud.api_vN package which imports (1) the client and (2) the enums module from the GAPIC, and (3) the types module (above bullet). These should be exported wholesale in __all__. See Vision for a reference implementation.
⚠️@landrito Add an unversioned file (e.g. vision.py) in the google.cloud namespace that imports each of the names from the latest GA versioned package and exports them wholesale in __all__. See Video Intelligence (not Vision) for a reference implementation.
Docs
⚠️@landrito Create a gapic directory in the docs with an api.rst and types.rst file. See Vision for a reference implementation.
⚠️ Create an index.rst file with the docs overview. See Vision for a reference implementation.
setup.py and requirements.txt
Remove requirements.txt entirely.
⚠️ Remove oauth2client from the dependency list in setup.py; add google-auth and requests.
* @jonparrott -- please verify that this is correct. Done.
Change the author from jjg+google-cloud-python@google.com to googleapis-packages@google.com.
⚠️ Remove dependencies on proto-google-cloud-*.
⚠️ Add google.cloud.gapic, google.cloud.proto, google.cloud.gapic.{api}, google.cloud.proto.{api} to namespace_packages.
⚠️ Add Python 3.6 to the list of tested Python versions.
Tests
Move tests out of their deeply nested subdirectory structure into simply tests/gapic/vN. Updated now that we have system tests: See Reorganize GAPIC tests #1401.
⚠️ Remove tox.ini, add appropriate nox.py.
Add tests for uncovered GAPIC lines.
Protos
Add a ref/ directory with the raw proto files; add this to MANIFEST.in.
This is a "catch-all ticket" of things I have identified that need doing in Python auto-gen.
Examples in this ticket will follow Vision (which I have hand-edited).
More important items are marked with⚠️ ; this ticket should be demoted to P2 once those are completed.
*_client.py (e.g. image_annotator_client.py)
stringshould be spelledstr.iteratorshould be spelledIterable.~.prefix if a period is present in the class name....for the prompt in hanging indents or continued statements (match the interpreter).pkg_resources.get_distributioncall needs to use the "manual" package name (e.g.google-cloud-vision), not the GAPIC package name. We are moving away from publishing stand-alone GAPIC packages.*_client.json (e.g. image_annotator_client.json)
image_annotator_config.py, and write the value to a variable in the top line. Alter the corresponding GAPIC Python file to import this rather than usingpkg_resources.resource_stringto load the JSON file.proto package
protoc-docs-pluginto artman. (Add Python documentation artman#217)Partial Veneer
google.cloudnamespace (e.g.google.cloud.vision_v1)types.pyfile to thegoogle.cloud.api_vNpackage which iterates over all the_pb2.pyfiles in the proto and makes the messages available in a consistent namespace (see Vision for a reference implementation).__init__.pyfile to thegoogle.cloud.api_vNpackage which imports (1) the client and (2) the enums module from the GAPIC, and (3) thetypesmodule (above bullet). These should be exported wholesale in__all__. See Vision for a reference implementation.vision.py) in thegoogle.cloudnamespace that imports each of the names from the latest GA versioned package and exports them wholesale in__all__. See Video Intelligence (not Vision) for a reference implementation.Docs
gapicdirectory in the docs with anapi.rstandtypes.rstfile. See Vision for a reference implementation.index.rstfile with the docs overview. See Vision for a reference implementation.setup.py and requirements.txt
requirements.txtentirely.oauth2clientfrom the dependency list insetup.py; addgoogle-authandrequests.*
@jonparrott -- please verify that this is correct.Done.jjg+google-cloud-python@google.comtogoogleapis-packages@google.com.proto-google-cloud-*.google.cloud.gapic,google.cloud.proto,google.cloud.gapic.{api},google.cloud.proto.{api}tonamespace_packages.Tests
tests/gapic/vN. Updated now that we have system tests: See Reorganize GAPIC tests #1401.tox.ini, add appropriatenox.py.Protos
ref/directory with the rawprotofiles; add this toMANIFEST.in.