Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Python: Auto-gen Improvements #1320

@lukesneeringer

Description

@lukesneeringer

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)

*_client.json (e.g. image_annotator_client.json)

  • 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.

proto package

Partial Veneer

  • ⚠️ @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.

Metadata

Metadata

Labels

lang: pythonIssues specific to Python.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions