-
Notifications
You must be signed in to change notification settings - Fork 130
Python: Introduced versioned api directory exporting types. #1368
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
|
||
/** 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
} | ||
|
||
private Set<ProtoFile> getProtofileDependencies(Model model) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
|
||
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this 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.
This comment was marked as spam.
Sorry, something went wrong.
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.
This comment was marked as spam.
Sorry, something went wrong.
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,39 @@ | |||
============== file: google/cloud/proto/example_v1/types.py ============== |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
from google.cloud.proto.example.library_v1 import types | ||
|
||
|
||
class LibraryServiceClient(LibraryHelpers, library_pb2.LibraryServiceClient): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
from google.cloud.proto.example_v1 import types | ||
|
||
|
||
class NoTemplatesAPIServiceClient(LibraryHelpers, no_path_templates_pb2.NoTemplatesAPIServiceClient): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -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.
Sorry, something went wrong.
Closing since this was done before the mvvm refactor. See new version of this at #1473. |
Updates #1320