Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Python: Introduced versioned api directory exporting types. #1368

Closed

Conversation

landrito
Copy link
Contributor

Updates #1320

@codecov-io
Copy link

codecov-io commented Jun 17, 2017

Codecov Report

Merging #1368 into master will increase coverage by 0.11%.
The diff coverage is 99.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1368      +/-   ##
============================================
+ Coverage     86.59%   86.71%   +0.11%     
- Complexity     3904     3942      +38     
============================================
  Files           382      383       +1     
  Lines         15632    15779     +147     
  Branches       1726     1736      +10     
============================================
+ Hits          13536    13682     +146     
- Misses         1634     1635       +1     
  Partials        462      462
Impacted Files Coverage Δ Complexity Δ
...en/viewmodel/metadata/VersionIndexRequireView.java 100% <ø> (ø) 2 <0> (ø) ⬇️
...i/codegen/viewmodel/metadata/VersionIndexView.java 83.33% <ø> (ø) 4 <0> (ø) ⬇️
...com/google/api/codegen/viewmodel/GrpcStubView.java 100% <ø> (ø) 2 <0> (ø) ⬇️
...om/google/api/codegen/util/py/PythonTypeTable.java 89.85% <100%> (ø) 21 <1> (ø) ⬇️
...e/api/codegen/transformer/GrpcStubTransformer.java 100% <100%> (ø) 7 <0> (ø) ⬇️
...api/codegen/transformer/py/PythonSurfaceNamer.java 95.04% <100%> (+0.42%) 42 <3> (+2) ⬆️
.../transformer/py/PythonGapicSurfaceTransformer.java 100% <100%> (ø) 13 <13> (?)
...le/api/codegen/gapic/MainGapicProviderFactory.java 94.79% <100%> (+0.12%) 18 <0> (ø) ⬇️
...transformer/py/PythonImportSectionTransformer.java 96.44% <100%> (+2.05%) 47 <19> (+19) ⬆️
...m/google/api/codegen/transformer/SurfaceNamer.java 79% <85.71%> (+0.16%) 176 <4> (+4) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3356ff...d67b4de. Read the comment docs.

Copy link
Contributor

@geigerj geigerj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just nits/optionals/questions. Please have @lukesneeringer confirm the baseline files meet his expectations.

@@ -159,6 +159,20 @@ public String getNamespace(Interface apiInterface) {
return qualifiedName(namePath.withoutHead());
}

/** The namespace of the package. */

This comment was marked as spam.

This comment was marked as spam.

}

/** The name of a stub type of an interface */
public String getStubType(Interface apiInterface) {

This comment was marked as spam.

This comment was marked as spam.

}
}

private Set<ProtoFile> getProtofileDependencies(Model model) {

This comment was marked as spam.

This comment was marked as spam.

}

Set<ImportFileView> imports = new TreeSet<>(importFileViewComparator());
// TODO: (landrito) Make this only generate the enums module if there are enums to export.

This comment was marked as spam.

This comment was marked as spam.

@@ -146,8 +146,8 @@ public String getParseFunctionName(String var, SingleResourceNameConfig resource

@Override
public String getGrpcClientTypeName(Interface apiInterface) {
String fullName = getModelTypeFormatter().getFullNameFor(apiInterface) + "Stub";
return getTypeNameConverter().getTypeName(fullName).getNickname();
String fullName = getModelTypeFormatter().getFullNameFor(apiInterface) + "Client";

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@lukesneeringer lukesneeringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two actual issues, repeated throughout.

wrappers_pb2
status_pb2):
for name, message in get_messages(module).items():
message.__module__ = 'google.cloud.proto.example.library_v1'

This comment was marked as spam.

descriptor_pb2
empty_pb2):
for name, message in get_messages(module).items():
message.__module__ = 'google.cloud.proto.example_v1'

This comment was marked as spam.

@@ -0,0 +1,65 @@
============== file: google/cloud/proto/example/library_v1/types.py ==============

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -0,0 +1,39 @@
============== file: google/cloud/proto/example_v1/types.py ==============

This comment was marked as spam.

from google.cloud.proto.example.library_v1 import types


class LibraryServiceClient(LibraryHelpers, library_pb2.LibraryServiceClient):

This comment was marked as spam.

from google.cloud.proto.example_v1 import types


class NoTemplatesAPIServiceClient(LibraryHelpers, no_path_templates_pb2.NoTemplatesAPIServiceClient):

This comment was marked as spam.

@@ -0,0 +1,65 @@
============== file: google/cloud/proto/example/library_v1/types.py ==============

This comment was marked as spam.

@landrito
Copy link
Contributor Author

landrito commented Aug 14, 2017

Closing since this was done before the mvvm refactor. See new version of this at #1473.

@landrito landrito closed this Aug 14, 2017
@landrito landrito deleted the python-autogen-improvements branch September 24, 2018 19:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants