From 690aee6d301dc9e621094e43e9221127b35d7587 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 27 Jan 2017 02:52:47 +0000 Subject: [PATCH 01/11] Automatedly advance ObjC version numbers --- gRPC-Core.podspec | 8 +- gRPC-ProtoRPC.podspec | 5 +- gRPC-RxLibrary.podspec | 4 +- gRPC.podspec | 4 +- .../!ProtoCompiler-gRPCPlugin.podspec | 7 +- src/objective-c/BoringSSL.podspec | 382 +++++++++--------- src/objective-c/GRPCClient/private/GRPCHost.m | 5 +- src/objective-c/GRPCClient/private/version.h | 34 ++ templates/gRPC-Core.podspec.template | 8 +- templates/gRPC-ProtoRPC.podspec.template | 66 +++ templates/gRPC-RxLibrary.podspec.template | 58 +++ templates/gRPC.podspec.template | 69 ++++ ...!ProtoCompiler-gRPCPlugin.podspec.template | 123 ++++++ .../GRPCClient/private/version.h.template | 36 ++ 14 files changed, 589 insertions(+), 220 deletions(-) create mode 100644 src/objective-c/GRPCClient/private/version.h create mode 100644 templates/gRPC-ProtoRPC.podspec.template create mode 100644 templates/gRPC-RxLibrary.podspec.template create mode 100644 templates/gRPC.podspec.template create mode 100644 templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template create mode 100644 templates/src/objective-c/GRPCClient/private/version.h.template diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index d9d0f1052fe..435de1b8d05 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -35,7 +35,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.0.2' + version = '1.1.0-dev' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'http://www.grpc.io' @@ -44,9 +44,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/grpc/grpc.git', - # TODO(mxyan): Change back to "v#{version}" for next release - #:tag => "v#{version}", - :tag => "objective-c-v#{version}", + :tag => "v#{version}", # TODO(jcanizales): Depend explicitly on the nanopb pod, and disable submodules. :submodules => true, } @@ -191,7 +189,7 @@ Pod::Spec.new do |s| ss.header_mappings_dir = '.' ss.libraries = 'z' ss.dependency "#{s.name}/Interface", version - ss.dependency 'BoringSSL', '~> 7.0' + ss.dependency 'BoringSSL', '~> 8.0' # To save you from scrolling, this is the last part of the podspec. ss.source_files = 'src/core/lib/profiling/timers.h', diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 62eaa2aaf7f..7c5fc49ffa8 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -27,10 +27,9 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.0.2' + version = '1.1.0-dev' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'http://www.grpc.io' @@ -39,7 +38,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/grpc/grpc.git', - :tag => "objective-c-v#{version}", + :tag => "v#{version}", } s.ios.deployment_target = '7.1' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 2e8fffd2f11..c8fdb8f3cc5 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.0.2' + version = '1.1.0-dev' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'http://www.grpc.io' @@ -39,7 +39,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/grpc/grpc.git', - :tag => "objective-c-v#{version}", + :tag => "v#{version}", } s.ios.deployment_target = '7.1' diff --git a/gRPC.podspec b/gRPC.podspec index e8b77094491..8f26dcfc4d7 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.0.2' + version = '1.1.0-dev' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'http://www.grpc.io' @@ -39,7 +39,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/grpc/grpc.git', - :tag => "objective-c-v#{version}", + :tag => "v#{version}", } s.ios.deployment_target = '7.1' diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index bcc2bb61265..09cf93d2a42 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.0.2' + v = '1.1.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC @@ -84,10 +84,7 @@ Pod::Spec.new do |s| repo = 'grpc/grpc' file = "grpc_objective_c_plugin-#{v}-macos-x86_64.zip" s.source = { - # TODO(mxyan): Change back to "https://github.com/#{repo}/releases/download/v#{v}/#{file}" for - # next release - # :http => "https://github.com/#{repo}/releases/download/v#{v}/#{file}", - :http => "https://github.com/#{repo}/releases/download/objective-c-v#{v}/#{file}", + :http => "https://github.com/#{repo}/releases/download/v#{v}/#{file}", # TODO(jcanizales): Add sha1 or sha256 # :sha1 => '??', } diff --git a/src/objective-c/BoringSSL.podspec b/src/objective-c/BoringSSL.podspec index 47b5b1a2e7b..908bb0b5e5e 100644 --- a/src/objective-c/BoringSSL.podspec +++ b/src/objective-c/BoringSSL.podspec @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.name = 'BoringSSL' - version = '7.0' + version = '8.0' s.version = version s.summary = 'BoringSSL is a fork of OpenSSL that is designed to meet Google’s needs.' # Adapted from the homepage: @@ -388,42 +388,42 @@ Pod::Spec.new do |s| 0x28340c19, 0x283480ac, 0x283500ea, - 0x2c322910, - 0x2c32a91e, - 0x2c332930, - 0x2c33a942, - 0x2c342956, - 0x2c34a968, - 0x2c352983, - 0x2c35a995, - 0x2c3629a8, + 0x2c3228ca, + 0x2c32a8d8, + 0x2c3328ea, + 0x2c33a8fc, + 0x2c342910, + 0x2c34a922, + 0x2c35293d, + 0x2c35a94f, + 0x2c362962, 0x2c36832d, - 0x2c3729b5, - 0x2c37a9c7, - 0x2c3829da, - 0x2c38a9f1, - 0x2c3929ff, - 0x2c39aa0f, - 0x2c3a2a21, - 0x2c3aaa35, - 0x2c3b2a46, - 0x2c3baa65, - 0x2c3c2a79, - 0x2c3caa8f, - 0x2c3d2aa8, - 0x2c3daac5, - 0x2c3e2ad6, - 0x2c3eaae4, - 0x2c3f2afc, - 0x2c3fab14, - 0x2c402b21, + 0x2c37296f, + 0x2c37a981, + 0x2c382994, + 0x2c38a9ab, + 0x2c3929b9, + 0x2c39a9c9, + 0x2c3a29db, + 0x2c3aa9ef, + 0x2c3b2a00, + 0x2c3baa1f, + 0x2c3c2a33, + 0x2c3caa49, + 0x2c3d2a62, + 0x2c3daa7f, + 0x2c3e2a90, + 0x2c3eaa9e, + 0x2c3f2ab6, + 0x2c3faace, + 0x2c402adb, 0x2c4090e7, - 0x2c412b32, - 0x2c41ab45, + 0x2c412aec, + 0x2c41aaff, 0x2c4210c0, - 0x2c42ab56, + 0x2c42ab10, 0x2c430720, - 0x2c43aa57, + 0x2c43aa11, 0x30320000, 0x30328015, 0x3033001f, @@ -639,74 +639,74 @@ Pod::Spec.new do |s| 0x405b1e9e, 0x405b9eaf, 0x405c1ec2, - 0x405c9ee3, - 0x405d1ef0, - 0x405d9f07, - 0x405e1f27, + 0x405c9ed3, + 0x405d1ee0, + 0x405d9ef7, + 0x405e1f17, 0x405e8a95, - 0x405f1f48, - 0x405f9f55, - 0x40601f63, - 0x40609f85, - 0x40611fad, - 0x40619fc2, - 0x40621fd9, - 0x40629fea, - 0x40631ffb, - 0x4063a010, - 0x40642027, - 0x4064a053, - 0x4065206e, - 0x4065a085, - 0x4066209d, - 0x4066a0c7, - 0x406720f2, - 0x4067a113, - 0x40682126, - 0x4068a147, - 0x40692179, - 0x4069a1a7, - 0x406a21c8, - 0x406aa1e8, - 0x406b2370, - 0x406ba393, - 0x406c23a9, - 0x406ca60b, - 0x406d263a, - 0x406da662, - 0x406e2690, - 0x406ea6a8, - 0x406f26c7, - 0x406fa6dc, - 0x407026ef, - 0x4070a70c, + 0x405f1f38, + 0x405f9f45, + 0x40601f53, + 0x40609f75, + 0x40611f9d, + 0x40619fb2, + 0x40621fc9, + 0x40629fda, + 0x40631feb, + 0x4063a000, + 0x40642017, + 0x4064a043, + 0x4065205e, + 0x4065a075, + 0x4066208d, + 0x4066a0b7, + 0x406720e2, + 0x4067a103, + 0x40682116, + 0x4068a137, + 0x40692169, + 0x4069a197, + 0x406a21b8, + 0x406aa1d8, + 0x406b2360, + 0x406ba383, + 0x406c2399, + 0x406ca5c5, + 0x406d25f4, + 0x406da61c, + 0x406e264a, + 0x406ea662, + 0x406f2681, + 0x406fa696, + 0x407026a9, + 0x4070a6c6, 0x40710800, - 0x4071a71e, - 0x40722731, - 0x4072a74a, - 0x40732762, + 0x4071a6d8, + 0x407226eb, + 0x4072a704, + 0x4073271c, 0x4073936d, - 0x40742776, - 0x4074a790, - 0x407527a1, - 0x4075a7b5, - 0x407627c3, + 0x40742730, + 0x4074a74a, + 0x4075275b, + 0x4075a76f, + 0x4076277d, 0x407691aa, - 0x407727e8, - 0x4077a80a, - 0x40782825, - 0x4078a85e, - 0x40792875, - 0x4079a88b, - 0x407a2897, - 0x407aa8aa, - 0x407b28bf, - 0x407ba8d1, - 0x407c28e6, - 0x407ca8ef, - 0x407d2162, + 0x407727a2, + 0x4077a7c4, + 0x407827df, + 0x4078a818, + 0x4079282f, + 0x4079a845, + 0x407a2851, + 0x407aa864, + 0x407b2879, + 0x407ba88b, + 0x407c28a0, + 0x407ca8a9, + 0x407d2152, 0x407d9c57, - 0x407e283a, + 0x407e27f4, 0x407e9e16, 0x407f1a67, 0x407f9887, @@ -714,45 +714,42 @@ Pod::Spec.new do |s| 0x40809a8f, 0x40811cd9, 0x40819c08, - 0x4082267b, + 0x40822635, 0x4082986d, 0x40831df1, - 0x4083a038, + 0x4083a028, 0x40841aa3, 0x40849e4e, - 0x40851ed3, - 0x41f4229b, - 0x41f9232d, - 0x41fe2220, - 0x41fea3fc, - 0x41ff24ed, - 0x420322b4, - 0x420822d6, - 0x4208a312, - 0x42092204, - 0x4209a34c, - 0x420a225b, - 0x420aa23b, - 0x420b227b, - 0x420ba2f4, - 0x420c2509, - 0x420ca3c9, - 0x420d23e3, - 0x420da41a, - 0x42122434, - 0x421724d0, - 0x4217a476, - 0x421c2498, - 0x421f2453, - 0x42212520, - 0x422624b3, - 0x422b25ef, - 0x422ba59d, - 0x422c25d7, - 0x422ca55c, - 0x422d253b, - 0x422da5bc, - 0x422e2582, + 0x41f4228b, + 0x41f9231d, + 0x41fe2210, + 0x41fea3ec, + 0x41ff24dd, + 0x420322a4, + 0x420822c6, + 0x4208a302, + 0x420921f4, + 0x4209a33c, + 0x420a224b, + 0x420aa22b, + 0x420b226b, + 0x420ba2e4, + 0x420c24f9, + 0x420ca3b9, + 0x420d23d3, + 0x420da40a, + 0x42122424, + 0x421724c0, + 0x4217a466, + 0x421c2488, + 0x421f2443, + 0x42212510, + 0x422624a3, + 0x422b25a9, + 0x422ba572, + 0x422c2591, + 0x422ca54c, + 0x422d252b, 0x4432072b, 0x4432873a, 0x44330746, @@ -795,69 +792,69 @@ Pod::Spec.new do |s| 0x4c3d136d, 0x4c3d937c, 0x4c3e1389, - 0x50322b68, - 0x5032ab77, - 0x50332b82, - 0x5033ab92, - 0x50342bab, - 0x5034abc5, - 0x50352bd3, - 0x5035abe9, - 0x50362bfb, - 0x5036ac11, - 0x50372c2a, - 0x5037ac3d, - 0x50382c55, - 0x5038ac66, - 0x50392c7b, - 0x5039ac8f, - 0x503a2caf, - 0x503aacc5, - 0x503b2cdd, - 0x503bacef, - 0x503c2d0b, - 0x503cad22, - 0x503d2d3b, - 0x503dad51, - 0x503e2d5e, - 0x503ead74, - 0x503f2d86, + 0x50322b22, + 0x5032ab31, + 0x50332b3c, + 0x5033ab4c, + 0x50342b65, + 0x5034ab7f, + 0x50352b8d, + 0x5035aba3, + 0x50362bb5, + 0x5036abcb, + 0x50372be4, + 0x5037abf7, + 0x50382c0f, + 0x5038ac20, + 0x50392c35, + 0x5039ac49, + 0x503a2c69, + 0x503aac7f, + 0x503b2c97, + 0x503baca9, + 0x503c2cc5, + 0x503cacdc, + 0x503d2cf5, + 0x503dad0b, + 0x503e2d18, + 0x503ead2e, + 0x503f2d40, 0x503f8382, - 0x50402d99, - 0x5040ada9, - 0x50412dc3, - 0x5041add2, - 0x50422dec, - 0x5042ae09, - 0x50432e19, - 0x5043ae29, - 0x50442e38, + 0x50402d53, + 0x5040ad63, + 0x50412d7d, + 0x5041ad8c, + 0x50422da6, + 0x5042adc3, + 0x50432dd3, + 0x5043ade3, + 0x50442df2, 0x5044843f, - 0x50452e4c, - 0x5045ae6a, - 0x50462e7d, - 0x5046ae93, - 0x50472ea5, - 0x5047aeba, - 0x50482ee0, - 0x5048aeee, - 0x50492f01, - 0x5049af16, - 0x504a2f2c, - 0x504aaf3c, - 0x504b2f5c, - 0x504baf6f, - 0x504c2f92, - 0x504cafc0, - 0x504d2fd2, - 0x504dafef, - 0x504e300a, - 0x504eb026, - 0x504f3038, - 0x504fb04f, - 0x5050305e, + 0x50452e06, + 0x5045ae24, + 0x50462e37, + 0x5046ae4d, + 0x50472e5f, + 0x5047ae74, + 0x50482e9a, + 0x5048aea8, + 0x50492ebb, + 0x5049aed0, + 0x504a2ee6, + 0x504aaef6, + 0x504b2f16, + 0x504baf29, + 0x504c2f4c, + 0x504caf7a, + 0x504d2f8c, + 0x504dafa9, + 0x504e2fc4, + 0x504eafe0, + 0x504f2ff2, + 0x504fb009, + 0x50503018, 0x505086ef, - 0x50513071, + 0x5051302b, 0x58320ec9, 0x68320e8b, 0x68328c25, @@ -1292,7 +1289,6 @@ Pod::Spec.new do |s| "NO_RENEGOTIATION\\0" "NO_REQUIRED_DIGEST\\0" "NO_SHARED_CIPHER\\0" - "NO_SHARED_GROUP\\0" "NULL_SSL_CTX\\0" "NULL_SSL_METHOD_PASSED\\0" "OLD_SESSION_CIPHER_NOT_RETURNED\\0" @@ -1353,9 +1349,7 @@ Pod::Spec.new do |s| "TLSV1_ALERT_USER_CANCELLED\\0" "TLSV1_BAD_CERTIFICATE_HASH_VALUE\\0" "TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\\0" - "TLSV1_CERTIFICATE_REQUIRED\\0" "TLSV1_CERTIFICATE_UNOBTAINABLE\\0" - "TLSV1_UNKNOWN_PSK_IDENTITY\\0" "TLSV1_UNRECOGNIZED_NAME\\0" "TLSV1_UNSUPPORTED_EXTENSION\\0" "TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\\0" diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index 450bec36e08..246af560cdb 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -45,13 +45,10 @@ #import "GRPCCompletionQueue.h" #import "GRPCConnectivityMonitor.h" #import "NSDictionary+GRPC.h" +#import "version.h" NS_ASSUME_NONNULL_BEGIN -// TODO(jcanizales): Generate the version in a standalone header, from templates. Like -// templates/src/core/surface/version.c.template . -#define GRPC_OBJC_VERSION_STRING @"1.0.2" - static NSMutableDictionary *kHostCache; // This connectivity monitor flushes the host cache when connectivity status diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h new file mode 100644 index 00000000000..55d38c235af --- /dev/null +++ b/src/objective-c/GRPCClient/private/version.h @@ -0,0 +1,34 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#define GRPC_OBJC_VERSION_STRING @"1.1.0-dev" diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index 1b97d18f163..baa9f5497da 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -62,7 +62,7 @@ %> Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.0.2' + version = '${settings.version}' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'http://www.grpc.io' @@ -71,9 +71,7 @@ s.source = { :git => 'https://github.com/grpc/grpc.git', - # TODO(mxyan): Change back to "v#{version}" for next release - #:tag => "v#{version}", - :tag => "objective-c-v#{version}", + :tag => "v#{version}", # TODO(jcanizales): Depend explicitly on the nanopb pod, and disable submodules. :submodules => true, } @@ -151,7 +149,7 @@ ss.header_mappings_dir = '.' ss.libraries = 'z' ss.dependency "#{s.name}/Interface", version - ss.dependency 'BoringSSL', '~> 7.0' + ss.dependency 'BoringSSL', '~> 8.0' # To save you from scrolling, this is the last part of the podspec. ss.source_files = ${ruby_multiline_list(grpc_private_files(libs), 22)} diff --git a/templates/gRPC-ProtoRPC.podspec.template b/templates/gRPC-ProtoRPC.podspec.template new file mode 100644 index 00000000000..aa74706997a --- /dev/null +++ b/templates/gRPC-ProtoRPC.podspec.template @@ -0,0 +1,66 @@ +%YAML 1.2 +--- | + # Copyright 2015, Google Inc. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are + # met: + # + # * Redistributions of source code must retain the above copyright + # notice, this list of conditions and the following disclaimer. + # * Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following disclaimer + # in the documentation and/or other materials provided with the + # distribution. + # * Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Pod::Spec.new do |s| + s.name = 'gRPC-ProtoRPC' + version = '${settings.version}' + s.version = version + s.summary = 'RPC library for Protocol Buffers, based on gRPC' + s.homepage = 'http://www.grpc.io' + s.license = 'New BSD' + s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } + + s.source = { + :git => 'https://github.com/grpc/grpc.git', + :tag => "v#{version}", + } + + s.ios.deployment_target = '7.1' + s.osx.deployment_target = '10.9' + + name = 'ProtoRPC' + s.module_name = name + s.header_dir = name + + src_dir = 'src/objective-c/ProtoRPC' + s.source_files = "#{src_dir}/*.{h,m}" + s.header_mappings_dir = "#{src_dir}" + + s.dependency 'gRPC', version + s.dependency 'gRPC-RxLibrary', version + s.dependency 'Protobuf', '~> 3.0' + s.pod_target_xcconfig = { + # This is needed by all pods that depend on Protobuf: + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', + # This is needed by all pods that depend on gRPC-RxLibrary: + 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', + } + end diff --git a/templates/gRPC-RxLibrary.podspec.template b/templates/gRPC-RxLibrary.podspec.template new file mode 100644 index 00000000000..99a40730fa2 --- /dev/null +++ b/templates/gRPC-RxLibrary.podspec.template @@ -0,0 +1,58 @@ +%YAML 1.2 +--- | + # Copyright 2015, Google Inc. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are + # met: + # + # * Redistributions of source code must retain the above copyright + # notice, this list of conditions and the following disclaimer. + # * Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following disclaimer + # in the documentation and/or other materials provided with the + # distribution. + # * Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + Pod::Spec.new do |s| + s.name = 'gRPC-RxLibrary' + version = '${settings.version}' + s.version = version + s.summary = 'Reactive Extensions library for iOS/OSX.' + s.homepage = 'http://www.grpc.io' + s.license = 'New BSD' + s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } + + s.source = { + :git => 'https://github.com/grpc/grpc.git', + :tag => "v#{version}", + } + + s.ios.deployment_target = '7.1' + s.osx.deployment_target = '10.9' + + name = 'RxLibrary' + s.module_name = name + s.header_dir = name + + src_dir = 'src/objective-c/RxLibrary' + s.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}" + s.private_header_files = "#{src_dir}/private/*.h" + s.header_mappings_dir = "#{src_dir}" + end diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template new file mode 100644 index 00000000000..8ccd1867dd0 --- /dev/null +++ b/templates/gRPC.podspec.template @@ -0,0 +1,69 @@ +%YAML 1.2 +--- | + # Copyright 2015, Google Inc. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are + # met: + # + # * Redistributions of source code must retain the above copyright + # notice, this list of conditions and the following disclaimer. + # * Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following disclaimer + # in the documentation and/or other materials provided with the + # distribution. + # * Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + Pod::Spec.new do |s| + s.name = 'gRPC' + version = '${settings.version}' + s.version = version + s.summary = 'gRPC client library for iOS/OSX' + s.homepage = 'http://www.grpc.io' + s.license = 'New BSD' + s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } + + s.source = { + :git => 'https://github.com/grpc/grpc.git', + :tag => "v#{version}", + } + + s.ios.deployment_target = '7.1' + s.osx.deployment_target = '10.9' + + name = 'GRPCClient' + s.module_name = name + s.header_dir = name + + src_dir = 'src/objective-c/GRPCClient' + s.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}" + s.private_header_files = "#{src_dir}/private/*.h" + s.header_mappings_dir = "#{src_dir}" + + s.dependency 'gRPC-Core', version + s.dependency 'gRPC-RxLibrary', version + + # Certificates, to be able to establish TLS connections: + s.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] } + + s.pod_target_xcconfig = { + # This is needed by all pods that depend on gRPC-RxLibrary: + 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', + } + end diff --git a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template new file mode 100644 index 00000000000..6c45fb45c04 --- /dev/null +++ b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template @@ -0,0 +1,123 @@ +%YAML 1.2 +--- | + # CocoaPods podspec for the gRPC Proto Compiler Plugin + + # Copyright 2016, Google Inc. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are + # met: + # + # * Redistributions of source code must retain the above copyright + # notice, this list of conditions and the following disclaimer. + # * Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following disclaimer + # in the documentation and/or other materials provided with the + # distribution. + # * Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Pod::Spec.new do |s| + # This pod is only a utility that will be used by other pods _at install time_ (not at compile + # time). Other pods can access it in their `prepare_command` script, under /. + # Because CocoaPods installs pods in alphabetical order, beginning this pod's name with an + # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed + # before them. + s.name = '!ProtoCompiler-gRPCPlugin' + v = '${settings.version}' + s.version = v + s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' + s.description = <<-DESC + This podspec only downloads the gRPC protoc plugin so that local pods generating protos can use + it in their invocation of protoc, as part of their prepare_command. + The generated code will have a dependency on the gRPC Objective-C Proto runtime of the same + version. The runtime can be obtained as the "gRPC-ProtoRPC" pod. + DESC + s.homepage = 'http://www.grpc.io' + s.license = { + :type => 'New BSD', + :text => <<-LICENSE + Copyright 2015, Google Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + LICENSE + } + s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } + + repo = 'grpc/grpc' + file = "grpc_objective_c_plugin-#{v}-macos-x86_64.zip" + s.source = { + :http => "https://github.com/#{repo}/releases/download/v#{v}/#{file}", + # TODO(jcanizales): Add sha1 or sha256 + # :sha1 => '??', + } + + repo_root = '../..' + plugin = 'grpc_objective_c_plugin' + + s.preserve_paths = plugin + + # Restrict the protoc version to the one supported by this plugin. + s.dependency '!ProtoCompiler', '3.0.2' + # For the Protobuf dependency not to complain: + s.ios.deployment_target = '7.1' + s.osx.deployment_target = '10.9' + # Restrict the gRPC runtime version to the one supported by this plugin. + s.dependency 'gRPC-ProtoRPC', v + + # This is only for local development of the plugin: If the Podfile brings this pod from a local + # directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be + # present in this pod's directory. We use that knowledge to check for the existence of the file + # and, if absent, compile the plugin from the local sources. + s.prepare_command = <<-CMD + if [ ! -f #{plugin} ]; then + cd #{repo_root} + # This will build the plugin and put it in #{repo_root}/bins/opt. + # + # TODO(jcanizales): I reckon make will try to use locally-installed libprotoc (headers and + # library binary) if found, which _we do not want_. Find a way for this to always use the + # sources in the repo. + make #{plugin} + cd - + fi + CMD + end diff --git a/templates/src/objective-c/GRPCClient/private/version.h.template b/templates/src/objective-c/GRPCClient/private/version.h.template new file mode 100644 index 00000000000..07df286c8b4 --- /dev/null +++ b/templates/src/objective-c/GRPCClient/private/version.h.template @@ -0,0 +1,36 @@ +%YAML 1.2 +--- | + /* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + #define GRPC_OBJC_VERSION_STRING @"${settings.version}" From 91bac1155d91c7cc6650fa3803308218bfea3266 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 30 Jan 2017 09:01:26 -0800 Subject: [PATCH 02/11] Empty line restore --- gRPC-ProtoRPC.podspec | 1 + templates/gRPC-ProtoRPC.podspec.template | 1 + 2 files changed, 2 insertions(+) diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 7c5fc49ffa8..4f061d30920 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -27,6 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' version = '1.1.0-dev' diff --git a/templates/gRPC-ProtoRPC.podspec.template b/templates/gRPC-ProtoRPC.podspec.template index aa74706997a..4b507d217c0 100644 --- a/templates/gRPC-ProtoRPC.podspec.template +++ b/templates/gRPC-ProtoRPC.podspec.template @@ -29,6 +29,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' version = '${settings.version}' From 27e9db4393431abb44b83e9844570bee352c80ff Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 30 Jan 2017 09:21:05 -0800 Subject: [PATCH 03/11] Add modification warning to templated files --- gRPC-Core.podspec | 10 ++++++---- gRPC-ProtoRPC.podspec | 6 ++++++ gRPC-RxLibrary.podspec | 6 ++++++ gRPC.podspec | 5 +++++ src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 8 +++++++- src/objective-c/GRPCClient/private/version.h | 3 +++ templates/gRPC-Core.podspec.template | 10 ++++++---- templates/gRPC-ProtoRPC.podspec.template | 6 ++++++ templates/gRPC-RxLibrary.podspec.template | 6 ++++++ templates/gRPC.podspec.template | 5 +++++ .../!ProtoCompiler-gRPCPlugin.podspec.template | 8 +++++++- .../objective-c/GRPCClient/private/version.h.template | 5 ++++- 12 files changed, 67 insertions(+), 11 deletions(-) diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 435de1b8d05..0654c8e1621 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1,8 +1,10 @@ -# GRPC CocoaPods podspec -# This file has been automatically generated from a template file. Please make modifications to -# `templates/gRPC-Core.podspec.template` instead. This file can be regenerated from the template by -# running `tools/buildgen/generate_projects.sh`. +# This file has been automatically generated from a template file. +# Please make modifications to `templates/gRPC-Core.podspec.template` +# instead. This file can be regenerated from the template by running +# `tools/buildgen/generate_projects.sh`. +# gRPC Core CocoaPods podspec +# # Copyright 2015, Google Inc. # All rights reserved. # diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 4f061d30920..85947a7176b 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -1,3 +1,9 @@ +# This file has been automatically generated from a template file. +# Please make modifications to +# `templates/gRPC-ProtoRPC.podspec.template` instead. This file can be +# regenerated from the template by running +# `tools/buildgen/generate_projects.sh`. + # Copyright 2015, Google Inc. # All rights reserved. # diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index c8fdb8f3cc5..293b90d0040 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -1,3 +1,9 @@ +# This file has been automatically generated from a template file. +# Please make modifications to +# `templates/gRPC-RxLibrary.podspec.template` instead. This file can be +# regenerated from the template by running +# `tools/buildgen/generate_projects.sh`. + # Copyright 2015, Google Inc. # All rights reserved. # diff --git a/gRPC.podspec b/gRPC.podspec index 8f26dcfc4d7..04f228e16ef 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -1,3 +1,8 @@ +# This file has been automatically generated from a template file. +# Please make modifications to `templates/gRPC.podspec.template` +# instead. This file can be regenerated from the template by running +# `tools/buildgen/generate_projects.sh`. + # Copyright 2015, Google Inc. # All rights reserved. # diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 09cf93d2a42..cbe8f4b6072 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -1,5 +1,11 @@ -# CocoaPods podspec for the gRPC Proto Compiler Plugin +# This file has been automatically generated from a template file. +# Please make modifications to +# `templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template` +# instead. This file can be regenerated from the template by running +# `tools/buildgen/generate_projects.sh`. +# CocoaPods podspec for the gRPC Proto Compiler Plugin +# # Copyright 2016, Google Inc. # All rights reserved. # diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index 55d38c235af..0d01dc31f76 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -31,4 +31,7 @@ * */ +/* This file is autogenerated from template: + * templates/src/objective-c/GRPCClient/private/version.h.template */ + #define GRPC_OBJC_VERSION_STRING @"1.1.0-dev" diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index baa9f5497da..18dabb9603b 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -1,10 +1,12 @@ %YAML 1.2 --- | - # GRPC CocoaPods podspec - # This file has been automatically generated from a template file. Please make modifications to - # `templates/gRPC-Core.podspec.template` instead. This file can be regenerated from the template by - # running `tools/buildgen/generate_projects.sh`. + # This file has been automatically generated from a template file. + # Please make modifications to `templates/gRPC-Core.podspec.template` + # instead. This file can be regenerated from the template by running + # `tools/buildgen/generate_projects.sh`. + # gRPC Core CocoaPods podspec + # # Copyright 2015, Google Inc. # All rights reserved. # diff --git a/templates/gRPC-ProtoRPC.podspec.template b/templates/gRPC-ProtoRPC.podspec.template index 4b507d217c0..5d7d90d2318 100644 --- a/templates/gRPC-ProtoRPC.podspec.template +++ b/templates/gRPC-ProtoRPC.podspec.template @@ -1,5 +1,11 @@ %YAML 1.2 --- | + # This file has been automatically generated from a template file. + # Please make modifications to + # `templates/gRPC-ProtoRPC.podspec.template` instead. This file can be + # regenerated from the template by running + # `tools/buildgen/generate_projects.sh`. + # Copyright 2015, Google Inc. # All rights reserved. # diff --git a/templates/gRPC-RxLibrary.podspec.template b/templates/gRPC-RxLibrary.podspec.template index 99a40730fa2..35a06c8a856 100644 --- a/templates/gRPC-RxLibrary.podspec.template +++ b/templates/gRPC-RxLibrary.podspec.template @@ -1,5 +1,11 @@ %YAML 1.2 --- | + # This file has been automatically generated from a template file. + # Please make modifications to + # `templates/gRPC-RxLibrary.podspec.template` instead. This file can be + # regenerated from the template by running + # `tools/buildgen/generate_projects.sh`. + # Copyright 2015, Google Inc. # All rights reserved. # diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index 8ccd1867dd0..d33ce277dc3 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -1,5 +1,10 @@ %YAML 1.2 --- | + # This file has been automatically generated from a template file. + # Please make modifications to `templates/gRPC.podspec.template` + # instead. This file can be regenerated from the template by running + # `tools/buildgen/generate_projects.sh`. + # Copyright 2015, Google Inc. # All rights reserved. # diff --git a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template index 6c45fb45c04..80420af7db2 100644 --- a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template +++ b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template @@ -1,7 +1,13 @@ %YAML 1.2 --- | - # CocoaPods podspec for the gRPC Proto Compiler Plugin + # This file has been automatically generated from a template file. + # Please make modifications to + # `templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template` + # instead. This file can be regenerated from the template by running + # `tools/buildgen/generate_projects.sh`. + # CocoaPods podspec for the gRPC Proto Compiler Plugin + # # Copyright 2016, Google Inc. # All rights reserved. # diff --git a/templates/src/objective-c/GRPCClient/private/version.h.template b/templates/src/objective-c/GRPCClient/private/version.h.template index 07df286c8b4..453604bdaac 100644 --- a/templates/src/objective-c/GRPCClient/private/version.h.template +++ b/templates/src/objective-c/GRPCClient/private/version.h.template @@ -32,5 +32,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ - + + /* This file is autogenerated from template: + * templates/src/objective-c/GRPCClient/private/version.h.template */ + #define GRPC_OBJC_VERSION_STRING @"${settings.version}" From 340bb83a59960e594f32cc31cb697c1f474db3e9 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Fri, 20 Jan 2017 14:49:30 -0500 Subject: [PATCH 04/11] Change shutdown_test.cc to use credential provider API to test against different credential types. --- test/cpp/end2end/shutdown_test.cc | 37 +++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/test/cpp/end2end/shutdown_test.cc b/test/cpp/end2end/shutdown_test.cc index 5b52b1fc1aa..bd68e851d3c 100644 --- a/test/cpp/end2end/shutdown_test.cc +++ b/test/cpp/end2end/shutdown_test.cc @@ -49,6 +49,7 @@ #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" +#include "test/cpp/util/test_credentials_provider.h" using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; @@ -72,7 +73,7 @@ class TestServiceImpl : public ::grpc::testing::EchoTestService::Service { gpr_event* ev_; }; -class ShutdownTest : public ::testing::Test { +class ShutdownTest : public ::testing::TestWithParam { public: ShutdownTest() : shutdown_(false), service_(&ev_) { gpr_event_init(&ev_); } @@ -85,7 +86,9 @@ class ShutdownTest : public ::testing::Test { grpc::string server_address = "localhost:" + to_string(port); ServerBuilder builder; - builder.AddListeningPort(server_address, InsecureServerCredentials()); + auto server_creds = + GetCredentialsProvider()->GetServerCredentials(GetParam()); + builder.AddListeningPort(server_address, server_creds); builder.RegisterService(&service_); std::unique_ptr server = builder.BuildAndStart(); return server; @@ -95,7 +98,10 @@ class ShutdownTest : public ::testing::Test { void ResetStub() { string target = "dns:localhost:" + to_string(port_); - channel_ = CreateChannel(target, InsecureChannelCredentials()); + ChannelArguments args; + auto channel_creds = + GetCredentialsProvider()->GetChannelCredentials(GetParam(), &args); + channel_ = CreateCustomChannel(target, channel_creds, args); stub_ = grpc::testing::EchoTestService::NewStub(channel_); } @@ -125,8 +131,31 @@ class ShutdownTest : public ::testing::Test { TestServiceImpl service_; }; +std::vector GetAllCredentialsTypeList() { + std::vector credentials_types; + if (GetCredentialsProvider()->GetChannelCredentials(kInsecureCredentialsType, + nullptr) != nullptr) { + credentials_types.push_back(kInsecureCredentialsType); + } + auto sec_list = GetCredentialsProvider()->GetSecureCredentialsTypeList(); + for (auto sec = sec_list.begin(); sec != sec_list.end(); sec++) { + credentials_types.push_back(*sec); + } + GPR_ASSERT(!credentials_types.empty()); + + std::string credentials_type_list("credentials types:"); + for (const string& type : credentials_types) { + credentials_type_list.append(" " + type); + } + gpr_log(GPR_INFO, "%s", credentials_type_list.c_str()); + return credentials_types; +} + +INSTANTIATE_TEST_CASE_P(End2EndShutdown, ShutdownTest, + ::testing::ValuesIn(GetAllCredentialsTypeList())); + // TODO(ctiller): leaked objects in this test -TEST_F(ShutdownTest, ShutdownTest) { +TEST_P(ShutdownTest, ShutdownTest) { ResetStub(); // send the request in a background thread From ae6290d1440243c85ced9bdf3f2c05efe8b27186 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 3 Feb 2017 13:32:12 -0800 Subject: [PATCH 05/11] Add regeneration info to version.h --- src/objective-c/GRPCClient/private/version.h | 7 +++++-- .../src/objective-c/GRPCClient/private/version.h.template | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index 0d01dc31f76..ac77fc8ead0 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -31,7 +31,10 @@ * */ -/* This file is autogenerated from template: - * templates/src/objective-c/GRPCClient/private/version.h.template */ +/* This file is autogenerated from a template file. Please make + * modifications to + * `templates/src/objective-c/GRPCClient/private/version.h.template` + * instead. This file can be regenerated from the template by running + * `tools/buildgen/generate_projects.sh`. */ #define GRPC_OBJC_VERSION_STRING @"1.1.0-dev" diff --git a/templates/src/objective-c/GRPCClient/private/version.h.template b/templates/src/objective-c/GRPCClient/private/version.h.template index 453604bdaac..5f41379a064 100644 --- a/templates/src/objective-c/GRPCClient/private/version.h.template +++ b/templates/src/objective-c/GRPCClient/private/version.h.template @@ -33,7 +33,10 @@ * */ - /* This file is autogenerated from template: - * templates/src/objective-c/GRPCClient/private/version.h.template */ + /* This file is autogenerated from a template file. Please make + * modifications to + * `templates/src/objective-c/GRPCClient/private/version.h.template` + * instead. This file can be regenerated from the template by running + * `tools/buildgen/generate_projects.sh`. */ #define GRPC_OBJC_VERSION_STRING @"${settings.version}" From e364b9ac5411515bd27c78b21deb7903939e5b2f Mon Sep 17 00:00:00 2001 From: Alex Polcyn Date: Fri, 3 Feb 2017 15:17:13 -0800 Subject: [PATCH 06/11] skip ruby tests on mac --- tools/run_tests/run_tests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 9d767258102..b765caf3427 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -645,11 +645,18 @@ class RubyLanguage(object): _check_compiler(self.args.compiler, ['default']) def test_specs(self): + #TODO(apolcyn) turn mac ruby tests back on once ruby 2.4 issues done + if platform_string() == 'mac': + print('skipping ruby test_specs on mac until running on 2.4') + return [] return [self.config.job_spec(['tools/run_tests/helper_scripts/run_ruby.sh'], timeout_seconds=10*60, environ=_FORCE_ENVIRON_FOR_WRAPPERS)] def pre_build_steps(self): + if platform_string() == 'mac': + print('skipping ruby pre_build_steps on mac until running on 2.4') + return [] return [['tools/run_tests/helper_scripts/pre_build_ruby.sh']] def make_targets(self): @@ -659,9 +666,15 @@ class RubyLanguage(object): return [] def build_steps(self): + if platform_string() == 'mac': + print('skipping ruby build_steps on mac until running on 2.4') + return [] return [['tools/run_tests/helper_scripts/build_ruby.sh']] def post_tests_steps(self): + if platform_string() == 'mac': + print('skipping ruby post_test_steps on mac until running on 2.4') + return [] return [['tools/run_tests/helper_scripts/post_tests_ruby.sh']] def makefile_name(self): From 1783bd3c99c51b75402fac2195926c1ffd3b6c72 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Sat, 4 Feb 2017 16:52:57 -0800 Subject: [PATCH 07/11] Correct commet style of version.h --- src/objective-c/GRPCClient/private/version.h | 11 ++++++----- .../objective-c/GRPCClient/private/version.h.template | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index ac77fc8ead0..bbb02d61bd6 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -31,10 +31,11 @@ * */ -/* This file is autogenerated from a template file. Please make - * modifications to - * `templates/src/objective-c/GRPCClient/private/version.h.template` - * instead. This file can be regenerated from the template by running - * `tools/buildgen/generate_projects.sh`. */ +// This file is autogenerated from a template file. Please make +// modifications to +// `templates/src/objective-c/GRPCClient/private/version.h.template` +// instead. This file can be regenerated from the template by running +// `tools/buildgen/generate_projects.sh`. + #define GRPC_OBJC_VERSION_STRING @"1.1.0-dev" diff --git a/templates/src/objective-c/GRPCClient/private/version.h.template b/templates/src/objective-c/GRPCClient/private/version.h.template index 5f41379a064..1d10692788e 100644 --- a/templates/src/objective-c/GRPCClient/private/version.h.template +++ b/templates/src/objective-c/GRPCClient/private/version.h.template @@ -33,10 +33,11 @@ * */ - /* This file is autogenerated from a template file. Please make - * modifications to - * `templates/src/objective-c/GRPCClient/private/version.h.template` - * instead. This file can be regenerated from the template by running - * `tools/buildgen/generate_projects.sh`. */ + // This file is autogenerated from a template file. Please make + // modifications to + // `templates/src/objective-c/GRPCClient/private/version.h.template` + // instead. This file can be regenerated from the template by running + // `tools/buildgen/generate_projects.sh`. + #define GRPC_OBJC_VERSION_STRING @"${settings.version}" From 2fa5f2f978fc68c732d6bfd35bcde1c7e7e4cf22 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Mon, 6 Feb 2017 10:27:09 -0800 Subject: [PATCH 08/11] Re-run yapf code, and pin version --- src/python/grpcio/commands.py | 4 +- src/python/grpcio/grpc/__init__.py | 57 ++++-------- src/python/grpcio/grpc/_channel.py | 51 +++++------ src/python/grpcio/grpc/_common.py | 12 ++- src/python/grpcio/grpc/_plugin_wrapping.py | 3 +- src/python/grpcio/grpc/_server.py | 29 +++--- src/python/grpcio/grpc/_utilities.py | 11 +-- .../grpcio/grpc/beta/_client_adaptations.py | 90 +++++++------------ .../grpcio/grpc/beta/_connectivity_channel.py | 4 +- .../grpcio/grpc/beta/_server_adaptations.py | 11 +-- .../framework/interfaces/base/utilities.py | 11 +-- .../grpc/framework/interfaces/face/face.py | 13 +-- src/python/grpcio/support.py | 4 +- src/python/grpcio_health_checking/setup.py | 9 +- src/python/grpcio_reflection/setup.py | 9 +- src/python/grpcio_tests/setup.py | 16 ++-- src/python/grpcio_tests/tests/_result.py | 4 +- .../tests/interop/_secure_intraop_test.py | 6 +- .../grpcio_tests/tests/interop/client.py | 5 +- .../grpcio_tests/tests/interop/methods.py | 45 +++------- .../protoc_plugin/_python_plugin_test.py | 6 +- .../reflection/_reflection_servicer_test.py | 39 ++++---- .../grpcio_tests/tests/stress/client.py | 5 +- .../grpcio_tests/tests/unit/_api_test.py | 66 +++++--------- .../tests/unit/_channel_args_test.py | 8 +- .../unit/_cython/_cancel_many_calls_test.py | 7 +- .../tests/unit/_cython/_channel_test.py | 4 +- .../_read_some_but_not_all_responses_test.py | 8 +- .../tests/unit/_invocation_defects_test.py | 16 +--- .../tests/unit/_metadata_code_details_test.py | 28 +++--- .../grpcio_tests/tests/unit/_rpc_test.py | 16 +--- .../tests/unit/beta/_beta_features_test.py | 12 +-- .../tests/unit/beta/_face_interface_test.py | 12 ++- .../tests/unit/beta/test_utilities.py | 5 +- .../unit/framework/interfaces/face/_digest.py | 9 +- .../framework/interfaces/face/_invocation.py | 6 +- .../grpcio_tests/tests/unit/test_common.py | 20 ++--- tools/distrib/yapf_code.sh | 3 +- 38 files changed, 237 insertions(+), 427 deletions(-) diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index d813df5f448..e50ccbe23e7 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -205,9 +205,7 @@ def check_and_update_cythonization(extensions): base, file_ext = os.path.splitext(source) if file_ext == '.pyx': generated_pyx_source = next((base + gen_ext - for gen_ext in ( - '.c', - '.cpp',) + for gen_ext in ('.c', '.cpp',) if os.path.isfile(base + gen_ext)), None) if generated_pyx_source: diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index fe299717992..b64a708cc78 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -1297,47 +1297,22 @@ def server(thread_pool, handlers=None, options=None): ################################### __all__ ################################# -__all__ = ( - 'FutureTimeoutError', - 'FutureCancelledError', - 'Future', - 'ChannelConnectivity', - 'StatusCode', - 'RpcError', - 'RpcContext', - 'Call', - 'ChannelCredentials', - 'CallCredentials', - 'AuthMetadataContext', - 'AuthMetadataPluginCallback', - 'AuthMetadataPlugin', - 'ServerCredentials', - 'UnaryUnaryMultiCallable', - 'UnaryStreamMultiCallable', - 'StreamUnaryMultiCallable', - 'StreamStreamMultiCallable', - 'Channel', - 'ServicerContext', - 'RpcMethodHandler', - 'HandlerCallDetails', - 'GenericRpcHandler', - 'ServiceRpcHandler', - 'Server', - 'unary_unary_rpc_method_handler', - 'unary_stream_rpc_method_handler', - 'stream_unary_rpc_method_handler', - 'stream_stream_rpc_method_handler', - 'method_handlers_generic_handler', - 'ssl_channel_credentials', - 'metadata_call_credentials', - 'access_token_call_credentials', - 'composite_call_credentials', - 'composite_channel_credentials', - 'ssl_server_credentials', - 'channel_ready_future', - 'insecure_channel', - 'secure_channel', - 'server',) +__all__ = ('FutureTimeoutError', 'FutureCancelledError', 'Future', + 'ChannelConnectivity', 'StatusCode', 'RpcError', 'RpcContext', + 'Call', 'ChannelCredentials', 'CallCredentials', + 'AuthMetadataContext', 'AuthMetadataPluginCallback', + 'AuthMetadataPlugin', 'ServerCredentials', 'UnaryUnaryMultiCallable', + 'UnaryStreamMultiCallable', 'StreamUnaryMultiCallable', + 'StreamStreamMultiCallable', 'Channel', 'ServicerContext', + 'RpcMethodHandler', 'HandlerCallDetails', 'GenericRpcHandler', + 'ServiceRpcHandler', 'Server', 'unary_unary_rpc_method_handler', + 'unary_stream_rpc_method_handler', 'stream_unary_rpc_method_handler', + 'stream_stream_rpc_method_handler', + 'method_handlers_generic_handler', 'ssl_channel_credentials', + 'metadata_call_credentials', 'access_token_call_credentials', + 'composite_call_credentials', 'composite_channel_credentials', + 'ssl_server_credentials', 'channel_ready_future', 'insecure_channel', + 'secure_channel', 'server',) ############################### Extension Shims ################################ diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index 77412236cc6..691e96a3228 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -45,28 +45,24 @@ _EMPTY_FLAGS = 0 _INFINITE_FUTURE = cygrpc.Timespec(float('+inf')) _EMPTY_METADATA = cygrpc.Metadata(()) -_UNARY_UNARY_INITIAL_DUE = ( - cygrpc.OperationType.send_initial_metadata, - cygrpc.OperationType.send_message, - cygrpc.OperationType.send_close_from_client, - cygrpc.OperationType.receive_initial_metadata, - cygrpc.OperationType.receive_message, - cygrpc.OperationType.receive_status_on_client,) -_UNARY_STREAM_INITIAL_DUE = ( - cygrpc.OperationType.send_initial_metadata, - cygrpc.OperationType.send_message, - cygrpc.OperationType.send_close_from_client, - cygrpc.OperationType.receive_initial_metadata, - cygrpc.OperationType.receive_status_on_client,) -_STREAM_UNARY_INITIAL_DUE = ( - cygrpc.OperationType.send_initial_metadata, - cygrpc.OperationType.receive_initial_metadata, - cygrpc.OperationType.receive_message, - cygrpc.OperationType.receive_status_on_client,) -_STREAM_STREAM_INITIAL_DUE = ( - cygrpc.OperationType.send_initial_metadata, - cygrpc.OperationType.receive_initial_metadata, - cygrpc.OperationType.receive_status_on_client,) +_UNARY_UNARY_INITIAL_DUE = (cygrpc.OperationType.send_initial_metadata, + cygrpc.OperationType.send_message, + cygrpc.OperationType.send_close_from_client, + cygrpc.OperationType.receive_initial_metadata, + cygrpc.OperationType.receive_message, + cygrpc.OperationType.receive_status_on_client,) +_UNARY_STREAM_INITIAL_DUE = (cygrpc.OperationType.send_initial_metadata, + cygrpc.OperationType.send_message, + cygrpc.OperationType.send_close_from_client, + cygrpc.OperationType.receive_initial_metadata, + cygrpc.OperationType.receive_status_on_client,) +_STREAM_UNARY_INITIAL_DUE = (cygrpc.OperationType.send_initial_metadata, + cygrpc.OperationType.receive_initial_metadata, + cygrpc.OperationType.receive_message, + cygrpc.OperationType.receive_status_on_client,) +_STREAM_STREAM_INITIAL_DUE = (cygrpc.OperationType.send_initial_metadata, + cygrpc.OperationType.receive_initial_metadata, + cygrpc.OperationType.receive_status_on_client,) _CHANNEL_SUBSCRIPTION_CALLBACK_ERROR_LOG_MESSAGE = ( 'Exception calling channel subscription callback!') @@ -568,9 +564,9 @@ class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable): )), event_handler) operations = ( cygrpc.operation_send_initial_metadata( - _common.cygrpc_metadata(metadata), _EMPTY_FLAGS), - cygrpc.operation_send_message(serialized_request, - _EMPTY_FLAGS), + _common.cygrpc_metadata(metadata), + _EMPTY_FLAGS), cygrpc.operation_send_message( + serialized_request, _EMPTY_FLAGS), cygrpc.operation_send_close_from_client(_EMPTY_FLAGS), cygrpc.operation_receive_status_on_client(_EMPTY_FLAGS),) call_error = call.start_client_batch( @@ -828,10 +824,7 @@ def _deliver(state, initial_connectivity, initial_callbacks): def _spawn_delivery(state, callbacks): delivering_thread = threading.Thread( - target=_deliver, args=( - state, - state.connectivity, - callbacks,)) + target=_deliver, args=(state, state.connectivity, callbacks,)) delivering_thread.start() state.delivering = True diff --git a/src/python/grpcio/grpc/_common.py b/src/python/grpcio/grpc/_common.py index 7ef2571379b..a5f1f38ea97 100644 --- a/src/python/grpcio/grpc/_common.py +++ b/src/python/grpcio/grpc/_common.py @@ -40,12 +40,16 @@ from grpc._cython import cygrpc _EMPTY_METADATA = cygrpc.Metadata(()) CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY = { - cygrpc.ConnectivityState.idle: grpc.ChannelConnectivity.IDLE, - cygrpc.ConnectivityState.connecting: grpc.ChannelConnectivity.CONNECTING, - cygrpc.ConnectivityState.ready: grpc.ChannelConnectivity.READY, + cygrpc.ConnectivityState.idle: + grpc.ChannelConnectivity.IDLE, + cygrpc.ConnectivityState.connecting: + grpc.ChannelConnectivity.CONNECTING, + cygrpc.ConnectivityState.ready: + grpc.ChannelConnectivity.READY, cygrpc.ConnectivityState.transient_failure: grpc.ChannelConnectivity.TRANSIENT_FAILURE, - cygrpc.ConnectivityState.shutdown: grpc.ChannelConnectivity.SHUTDOWN, + cygrpc.ConnectivityState.shutdown: + grpc.ChannelConnectivity.SHUTDOWN, } CYGRPC_STATUS_CODE_TO_STATUS_CODE = { diff --git a/src/python/grpcio/grpc/_plugin_wrapping.py b/src/python/grpcio/grpc/_plugin_wrapping.py index bb9a42f3ffe..69c46aa546c 100644 --- a/src/python/grpcio/grpc/_plugin_wrapping.py +++ b/src/python/grpcio/grpc/_plugin_wrapping.py @@ -37,8 +37,7 @@ from grpc._cython import cygrpc class AuthMetadataContext( collections.namedtuple('AuthMetadataContext', ( - 'service_url', - 'method_name',)), grpc.AuthMetadataContext): + 'service_url', 'method_name',)), grpc.AuthMetadataContext): pass diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index 31551e0f1bd..bf2743c16b9 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -91,8 +91,7 @@ def _details(state): class _HandlerCallDetails( collections.namedtuple('_HandlerCallDetails', ( - 'method', - 'invocation_metadata',)), grpc.HandlerCallDetails): + 'method', 'invocation_metadata',)), grpc.HandlerCallDetails): pass @@ -143,12 +142,11 @@ def _abort(state, call, code, details): effective_code = _abortion_code(state, code) effective_details = details if state.details is None else state.details if state.initial_metadata_allowed: - operations = ( - cygrpc.operation_send_initial_metadata(_EMPTY_METADATA, - _EMPTY_FLAGS), - cygrpc.operation_send_status_from_server( - _common.cygrpc_metadata(state.trailing_metadata), - effective_code, effective_details, _EMPTY_FLAGS),) + operations = (cygrpc.operation_send_initial_metadata( + _EMPTY_METADATA, _EMPTY_FLAGS), + cygrpc.operation_send_status_from_server( + _common.cygrpc_metadata(state.trailing_metadata), + effective_code, effective_details, _EMPTY_FLAGS),) token = _SEND_INITIAL_METADATA_AND_SEND_STATUS_FROM_SERVER_TOKEN else: operations = (cygrpc.operation_send_status_from_server( @@ -417,11 +415,10 @@ def _send_response(rpc_event, state, serialized_response): return False else: if state.initial_metadata_allowed: - operations = ( - cygrpc.operation_send_initial_metadata(_EMPTY_METADATA, - _EMPTY_FLAGS), - cygrpc.operation_send_message(serialized_response, - _EMPTY_FLAGS),) + operations = (cygrpc.operation_send_initial_metadata( + _EMPTY_METADATA, _EMPTY_FLAGS), + cygrpc.operation_send_message(serialized_response, + _EMPTY_FLAGS),) state.initial_metadata_allowed = False token = _SEND_INITIAL_METADATA_AND_SEND_MESSAGE_TOKEN else: @@ -559,10 +556,8 @@ def _handle_unrecognized_method(rpc_event): _EMPTY_METADATA, cygrpc.StatusCode.unimplemented, b'Method not found!', _EMPTY_FLAGS),) rpc_state = _RPCState() - rpc_event.operation_call.start_server_batch(operations, - lambda ignored_event: ( - rpc_state, - (),)) + rpc_event.operation_call.start_server_batch( + operations, lambda ignored_event: (rpc_state, (),)) return rpc_state diff --git a/src/python/grpcio/grpc/_utilities.py b/src/python/grpcio/grpc/_utilities.py index 7c602eb37e3..d5a7b2aeef9 100644 --- a/src/python/grpcio/grpc/_utilities.py +++ b/src/python/grpcio/grpc/_utilities.py @@ -44,14 +44,9 @@ _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE = ( class RpcMethodHandler( collections.namedtuple('_RpcMethodHandler', ( - 'request_streaming', - 'response_streaming', - 'request_deserializer', - 'response_serializer', - 'unary_unary', - 'unary_stream', - 'stream_unary', - 'stream_stream',)), grpc.RpcMethodHandler): + 'request_streaming', 'response_streaming', 'request_deserializer', + 'response_serializer', 'unary_unary', 'unary_stream', + 'stream_unary', 'stream_stream',)), grpc.RpcMethodHandler): pass diff --git a/src/python/grpcio/grpc/beta/_client_adaptations.py b/src/python/grpcio/grpc/beta/_client_adaptations.py index e5b28e9408e..b53395e2a2e 100644 --- a/src/python/grpcio/grpc/beta/_client_adaptations.py +++ b/src/python/grpcio/grpc/beta/_client_adaptations.py @@ -454,12 +454,9 @@ class _GenericStub(face.GenericStub): metadata=None, with_call=None, protocol_options=None): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _blocking_unary_unary(self._channel, group, method, timeout, with_call, protocol_options, metadata, self._metadata_transformer, request, @@ -472,12 +469,9 @@ class _GenericStub(face.GenericStub): timeout, metadata=None, protocol_options=None): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _future_unary_unary(self._channel, group, method, timeout, protocol_options, metadata, self._metadata_transformer, request, @@ -490,12 +484,9 @@ class _GenericStub(face.GenericStub): timeout, metadata=None, protocol_options=None): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _unary_stream(self._channel, group, method, timeout, protocol_options, metadata, self._metadata_transformer, request, @@ -509,12 +500,9 @@ class _GenericStub(face.GenericStub): metadata=None, with_call=None, protocol_options=None): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _blocking_stream_unary( self._channel, group, method, timeout, with_call, protocol_options, metadata, self._metadata_transformer, request_iterator, @@ -527,12 +515,9 @@ class _GenericStub(face.GenericStub): timeout, metadata=None, protocol_options=None): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _future_stream_unary( self._channel, group, method, timeout, protocol_options, metadata, self._metadata_transformer, request_iterator, request_serializer, @@ -545,12 +530,9 @@ class _GenericStub(face.GenericStub): timeout, metadata=None, protocol_options=None): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _stream_stream(self._channel, group, method, timeout, protocol_options, metadata, self._metadata_transformer, request_iterator, @@ -599,45 +581,33 @@ class _GenericStub(face.GenericStub): raise NotImplementedError() def unary_unary(self, group, method): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _UnaryUnaryMultiCallable( self._channel, group, method, self._metadata_transformer, request_serializer, response_deserializer) def unary_stream(self, group, method): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _UnaryStreamMultiCallable( self._channel, group, method, self._metadata_transformer, request_serializer, response_deserializer) def stream_unary(self, group, method): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _StreamUnaryMultiCallable( self._channel, group, method, self._metadata_transformer, request_serializer, response_deserializer) def stream_stream(self, group, method): - request_serializer = self._request_serializers.get(( - group, - method,)) - response_deserializer = self._response_deserializers.get(( - group, - method,)) + request_serializer = self._request_serializers.get((group, method,)) + response_deserializer = self._response_deserializers.get((group, + method,)) return _StreamStreamMultiCallable( self._channel, group, method, self._metadata_transformer, request_serializer, response_deserializer) diff --git a/src/python/grpcio/grpc/beta/_connectivity_channel.py b/src/python/grpcio/grpc/beta/_connectivity_channel.py index 39020d2b4ef..bfb847f80af 100644 --- a/src/python/grpcio/grpc/beta/_connectivity_channel.py +++ b/src/python/grpcio/grpc/beta/_connectivity_channel.py @@ -85,9 +85,7 @@ class ConnectivityChannel(object): def _spawn_delivery(self, connectivity, callbacks): delivering_thread = threading.Thread( - target=self._deliver, args=( - connectivity, - callbacks,)) + target=self._deliver, args=(connectivity, callbacks,)) delivering_thread.start() self._delivering = True diff --git a/src/python/grpcio/grpc/beta/_server_adaptations.py b/src/python/grpcio/grpc/beta/_server_adaptations.py index 206bd7e4681..174af2d6422 100644 --- a/src/python/grpcio/grpc/beta/_server_adaptations.py +++ b/src/python/grpcio/grpc/beta/_server_adaptations.py @@ -256,14 +256,9 @@ def _adapt_stream_stream_event(stream_stream_event): class _SimpleMethodHandler( collections.namedtuple('_MethodHandler', ( - 'request_streaming', - 'response_streaming', - 'request_deserializer', - 'response_serializer', - 'unary_unary', - 'unary_stream', - 'stream_unary', - 'stream_stream',)), grpc.RpcMethodHandler): + 'request_streaming', 'response_streaming', 'request_deserializer', + 'response_serializer', 'unary_unary', 'unary_stream', + 'stream_unary', 'stream_stream',)), grpc.RpcMethodHandler): pass diff --git a/src/python/grpcio/grpc/framework/interfaces/base/utilities.py b/src/python/grpcio/grpc/framework/interfaces/base/utilities.py index 461706ff9f2..80d5d25c12b 100644 --- a/src/python/grpcio/grpc/framework/interfaces/base/utilities.py +++ b/src/python/grpcio/grpc/framework/interfaces/base/utilities.py @@ -34,19 +34,14 @@ from grpc.framework.interfaces.base import base class _Completion(base.Completion, - collections.namedtuple('_Completion', ( - 'terminal_metadata', - 'code', - 'message',))): + collections.namedtuple('_Completion', ('terminal_metadata', + 'code', 'message',))): """A trivial implementation of base.Completion.""" class _Subscription(base.Subscription, collections.namedtuple('_Subscription', ( - 'kind', - 'termination_callback', - 'allowance', - 'operator', + 'kind', 'termination_callback', 'allowance', 'operator', 'protocol_receiver',))): """A trivial implementation of base.Subscription.""" diff --git a/src/python/grpcio/grpc/framework/interfaces/face/face.py b/src/python/grpcio/grpc/framework/interfaces/face/face.py index 36ddca18c14..6c7e2a3af6a 100644 --- a/src/python/grpcio/grpc/framework/interfaces/face/face.py +++ b/src/python/grpcio/grpc/framework/interfaces/face/face.py @@ -63,18 +63,13 @@ class NoSuchMethodError(Exception): self.method = method def __repr__(self): - return 'face.NoSuchMethodError(%s, %s)' % ( - self.group, - self.method,) + return 'face.NoSuchMethodError(%s, %s)' % (self.group, self.method,) class Abortion( - collections.namedtuple('Abortion', ( - 'kind', - 'initial_metadata', - 'terminal_metadata', - 'code', - 'details',))): + collections.namedtuple('Abortion', + ('kind', 'initial_metadata', 'terminal_metadata', + 'code', 'details',))): """A value describing RPC abortion. Attributes: diff --git a/src/python/grpcio/support.py b/src/python/grpcio/support.py index a228ba4a482..edc6def8386 100644 --- a/src/python/grpcio/support.py +++ b/src/python/grpcio/support.py @@ -53,7 +53,9 @@ Could not find . This could mean the following: (check your environment variables or try re-installing?) """ -C_CHECKS = {C_PYTHON_DEV: C_PYTHON_DEV_ERROR_MESSAGE,} +C_CHECKS = { + C_PYTHON_DEV: C_PYTHON_DEV_ERROR_MESSAGE, +} def _compile(compiler, source_string): diff --git a/src/python/grpcio_health_checking/setup.py b/src/python/grpcio_health_checking/setup.py index 4c3991dcc4a..072c3263c6e 100644 --- a/src/python/grpcio_health_checking/setup.py +++ b/src/python/grpcio_health_checking/setup.py @@ -40,14 +40,15 @@ os.chdir(os.path.dirname(os.path.abspath(__file__))) import health_commands import grpc_version -PACKAGE_DIRECTORIES = {'': '.',} +PACKAGE_DIRECTORIES = { + '': '.', +} SETUP_REQUIRES = ( 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),) -INSTALL_REQUIRES = ( - 'protobuf>=3.0.0', - 'grpcio>={version}'.format(version=grpc_version.VERSION),) +INSTALL_REQUIRES = ('protobuf>=3.0.0', + 'grpcio>={version}'.format(version=grpc_version.VERSION),) COMMAND_CLASS = { # Run preprocess from the repository *before* doing any packaging! diff --git a/src/python/grpcio_reflection/setup.py b/src/python/grpcio_reflection/setup.py index 2926923029a..19aafe443a9 100644 --- a/src/python/grpcio_reflection/setup.py +++ b/src/python/grpcio_reflection/setup.py @@ -40,14 +40,15 @@ os.chdir(os.path.dirname(os.path.abspath(__file__))) import reflection_commands import grpc_version -PACKAGE_DIRECTORIES = {'': '.',} +PACKAGE_DIRECTORIES = { + '': '.', +} SETUP_REQUIRES = ( 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),) -INSTALL_REQUIRES = ( - 'protobuf>=3.0.0', - 'grpcio>={version}'.format(version=grpc_version.VERSION),) +INSTALL_REQUIRES = ('protobuf>=3.0.0', + 'grpcio>={version}'.format(version=grpc_version.VERSION),) COMMAND_CLASS = { # Run preprocess from the repository *before* doing any packaging! diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py index f0407d1a557..b0c73fc575b 100644 --- a/src/python/grpcio_tests/setup.py +++ b/src/python/grpcio_tests/setup.py @@ -47,18 +47,16 @@ import grpc_version LICENSE = '3-clause BSD' -PACKAGE_DIRECTORIES = {'': '.',} +PACKAGE_DIRECTORIES = { + '': '.', +} INSTALL_REQUIRES = ( - 'coverage>=4.0', - 'enum34>=1.0.4', - 'futures>=2.2.0', + 'coverage>=4.0', 'enum34>=1.0.4', 'futures>=2.2.0', 'grpcio>={version}'.format(version=grpc_version.VERSION), 'grpcio-tools>={version}'.format(version=grpc_version.VERSION), 'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION), - 'oauth2client>=1.4.7', - 'protobuf>=3.0.0', - 'six>=1.10',) + 'oauth2client>=1.4.7', 'protobuf>=3.0.0', 'six>=1.10',) COMMAND_CLASS = { # Run `preprocess` *before* doing any packaging! @@ -75,7 +73,9 @@ PACKAGE_DATA = { 'credentials/server1.key', 'credentials/server1.pem', ], - 'tests.protoc_plugin.protos.invocation_testing': ['same.proto',], + 'tests.protoc_plugin.protos.invocation_testing': [ + 'same.proto', + ], 'tests.protoc_plugin.protos.invocation_testing.split_messages': [ 'messages.proto', ], diff --git a/src/python/grpcio_tests/tests/_result.py b/src/python/grpcio_tests/tests/_result.py index 794b7540f14..22c667b4608 100644 --- a/src/python/grpcio_tests/tests/_result.py +++ b/src/python/grpcio_tests/tests/_result.py @@ -453,7 +453,9 @@ def jenkins_junit_xml(result): }) for case in result.cases.values(): if case.kind is CaseResult.Kind.SUCCESS: - ElementTree.SubElement(suite, 'testcase', {'name': case.name,}) + ElementTree.SubElement(suite, 'testcase', { + 'name': case.name, + }) elif case.kind in (CaseResult.Kind.ERROR, CaseResult.Kind.FAILURE): case_xml = ElementTree.SubElement(suite, 'testcase', { 'name': case.name, diff --git a/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py b/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py index b28406ed3ff..5fe929b99ed 100644 --- a/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py +++ b/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py @@ -55,9 +55,9 @@ class SecureIntraopTest(_intraop_test_case.IntraopTestCase, unittest.TestCase): self.stub = test_pb2.TestServiceStub( grpc.secure_channel('localhost:{}'.format(port), grpc.ssl_channel_credentials( - resources.test_root_certificates()), (( - 'grpc.ssl_target_name_override', - _SERVER_HOST_OVERRIDE,),))) + resources.test_root_certificates()), ( + ('grpc.ssl_target_name_override', + _SERVER_HOST_OVERRIDE,),))) if __name__ == '__main__': diff --git a/src/python/grpcio_tests/tests/interop/client.py b/src/python/grpcio_tests/tests/interop/client.py index f177896e8e6..833818e6625 100644 --- a/src/python/grpcio_tests/tests/interop/client.py +++ b/src/python/grpcio_tests/tests/interop/client.py @@ -116,9 +116,8 @@ def _stub(args): channel_credentials = grpc.composite_channel_credentials( channel_credentials, call_credentials) - channel = grpc.secure_channel(target, channel_credentials, (( - 'grpc.ssl_target_name_override', - args.server_host_override,),)) + channel = grpc.secure_channel(target, channel_credentials, ( + ('grpc.ssl_target_name_override', args.server_host_override,),)) else: channel = grpc.insecure_channel(target) if args.test_case == "unimplemented_service": diff --git a/src/python/grpcio_tests/tests/interop/methods.py b/src/python/grpcio_tests/tests/interop/methods.py index 1f9b356eb2d..662ea9ce570 100644 --- a/src/python/grpcio_tests/tests/interop/methods.py +++ b/src/python/grpcio_tests/tests/interop/methods.py @@ -165,11 +165,7 @@ def _large_unary(stub): def _client_streaming(stub): - payload_body_sizes = ( - 27182, - 8, - 1828, - 45904,) + payload_body_sizes = (27182, 8, 1828, 45904,) payloads = (messages_pb2.Payload(body=b'\x00' * size) for size in payload_body_sizes) requests = (messages_pb2.StreamingInputCallRequest(payload=payload) @@ -181,19 +177,14 @@ def _client_streaming(stub): def _server_streaming(stub): - sizes = ( - 31415, - 9, - 2653, - 58979,) + sizes = (31415, 9, 2653, 58979,) request = messages_pb2.StreamingOutputCallRequest( response_type=messages_pb2.COMPRESSABLE, - response_parameters=( - messages_pb2.ResponseParameters(size=sizes[0]), - messages_pb2.ResponseParameters(size=sizes[1]), - messages_pb2.ResponseParameters(size=sizes[2]), - messages_pb2.ResponseParameters(size=sizes[3]),)) + response_parameters=(messages_pb2.ResponseParameters(size=sizes[0]), + messages_pb2.ResponseParameters(size=sizes[1]), + messages_pb2.ResponseParameters(size=sizes[2]), + messages_pb2.ResponseParameters(size=sizes[3]),)) response_iterator = stub.StreamingOutputCall(request) for index, response in enumerate(response_iterator): _validate_payload_type_and_length(response, messages_pb2.COMPRESSABLE, @@ -240,16 +231,8 @@ class _Pipe(object): def _ping_pong(stub): - request_response_sizes = ( - 31415, - 9, - 2653, - 58979,) - request_payload_sizes = ( - 27182, - 8, - 1828, - 45904,) + request_response_sizes = (31415, 9, 2653, 58979,) + request_payload_sizes = (27182, 8, 1828, 45904,) with _Pipe() as pipe: response_iterator = stub.FullDuplexCall(pipe) @@ -277,16 +260,8 @@ def _cancel_after_begin(stub): def _cancel_after_first_response(stub): - request_response_sizes = ( - 31415, - 9, - 2653, - 58979,) - request_payload_sizes = ( - 27182, - 8, - 1828, - 45904,) + request_response_sizes = (31415, 9, 2653, 58979,) + request_payload_sizes = (27182, 8, 1828, 45904,) with _Pipe() as pipe: response_iterator = stub.FullDuplexCall(pipe) diff --git a/src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py b/src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py index ae5da2c3dbe..a6e3ca0b23b 100644 --- a/src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py +++ b/src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py @@ -134,10 +134,8 @@ class _ServicerMethods(object): class _Service( - collections.namedtuple('_Service', ( - 'servicer_methods', - 'server', - 'stub',))): + collections.namedtuple('_Service', ('servicer_methods', 'server', + 'stub',))): """A live and running service. Attributes: diff --git a/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py b/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py index 76e89ca039f..d06ff064e24 100644 --- a/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py +++ b/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py @@ -69,11 +69,10 @@ class ReflectionServicerTest(unittest.TestCase): self._stub = reflection_pb2.ServerReflectionStub(channel) def testFileByName(self): - requests = ( - reflection_pb2.ServerReflectionRequest( - file_by_filename=_EMPTY_PROTO_FILE_NAME), - reflection_pb2.ServerReflectionRequest( - file_by_filename='i-donut-exist'),) + requests = (reflection_pb2.ServerReflectionRequest( + file_by_filename=_EMPTY_PROTO_FILE_NAME), + reflection_pb2.ServerReflectionRequest( + file_by_filename='i-donut-exist'),) responses = tuple(self._stub.ServerReflectionInfo(iter(requests))) expected_responses = ( reflection_pb2.ServerReflectionResponse( @@ -90,12 +89,10 @@ class ReflectionServicerTest(unittest.TestCase): self.assertSequenceEqual(expected_responses, responses) def testFileBySymbol(self): - requests = ( - reflection_pb2.ServerReflectionRequest( - file_containing_symbol=_EMPTY_PROTO_SYMBOL_NAME), - reflection_pb2.ServerReflectionRequest( - file_containing_symbol='i.donut.exist.co.uk.org.net.me.name.foo' - ),) + requests = (reflection_pb2.ServerReflectionRequest( + file_containing_symbol=_EMPTY_PROTO_SYMBOL_NAME + ), reflection_pb2.ServerReflectionRequest( + file_containing_symbol='i.donut.exist.co.uk.org.net.me.name.foo'),) responses = tuple(self._stub.ServerReflectionInfo(iter(requests))) expected_responses = ( reflection_pb2.ServerReflectionResponse( @@ -115,15 +112,14 @@ class ReflectionServicerTest(unittest.TestCase): 'TODO(atash): implement file-containing-extension reflection ' '(see https://github.com/google/protobuf/issues/2248)') def testFileContainingExtension(self): - requests = ( - reflection_pb2.ServerReflectionRequest( - file_containing_extension=reflection_pb2.ExtensionRequest( - containing_type='grpc.testing.proto2.Empty', - extension_number=125,),), - reflection_pb2.ServerReflectionRequest( - file_containing_extension=reflection_pb2.ExtensionRequest( - containing_type='i.donut.exist.co.uk.org.net.me.name.foo', - extension_number=55,),),) + requests = (reflection_pb2.ServerReflectionRequest( + file_containing_extension=reflection_pb2.ExtensionRequest( + containing_type='grpc.testing.proto2.Empty', + extension_number=125,), + ), reflection_pb2.ServerReflectionRequest( + file_containing_extension=reflection_pb2.ExtensionRequest( + containing_type='i.donut.exist.co.uk.org.net.me.name.foo', + extension_number=55,),),) responses = tuple(self._stub.ServerReflectionInfo(iter(requests))) expected_responses = ( reflection_pb2.ServerReflectionResponse( @@ -140,7 +136,8 @@ class ReflectionServicerTest(unittest.TestCase): self.assertSequenceEqual(expected_responses, responses) def testListServices(self): - requests = (reflection_pb2.ServerReflectionRequest(list_services='',),) + requests = (reflection_pb2.ServerReflectionRequest( + list_services='',),) responses = tuple(self._stub.ServerReflectionInfo(iter(requests))) expected_responses = (reflection_pb2.ServerReflectionResponse( valid_host='', diff --git a/src/python/grpcio_tests/tests/stress/client.py b/src/python/grpcio_tests/tests/stress/client.py index 61f9e1c6b17..b9dbe61d44b 100644 --- a/src/python/grpcio_tests/tests/stress/client.py +++ b/src/python/grpcio_tests/tests/stress/client.py @@ -117,9 +117,8 @@ def _get_channel(target, args): root_certificates = None # will load default roots. channel_credentials = grpc.ssl_channel_credentials( root_certificates=root_certificates) - options = (( - 'grpc.ssl_target_name_override', - args.server_host_override,),) + options = (('grpc.ssl_target_name_override', + args.server_host_override,),) channel = grpc.secure_channel( target, channel_credentials, options=options) else: diff --git a/src/python/grpcio_tests/tests/unit/_api_test.py b/src/python/grpcio_tests/tests/unit/_api_test.py index 5435c5500cc..40c4f0a22a6 100644 --- a/src/python/grpcio_tests/tests/unit/_api_test.py +++ b/src/python/grpcio_tests/tests/unit/_api_test.py @@ -41,46 +41,23 @@ class AllTest(unittest.TestCase): def testAll(self): expected_grpc_code_elements = ( - 'FutureTimeoutError', - 'FutureCancelledError', - 'Future', - 'ChannelConnectivity', - 'StatusCode', - 'RpcError', - 'RpcContext', - 'Call', - 'ChannelCredentials', - 'CallCredentials', - 'AuthMetadataContext', - 'AuthMetadataPluginCallback', - 'AuthMetadataPlugin', - 'ServerCredentials', - 'UnaryUnaryMultiCallable', - 'UnaryStreamMultiCallable', - 'StreamUnaryMultiCallable', - 'StreamStreamMultiCallable', - 'Channel', - 'ServicerContext', - 'RpcMethodHandler', - 'HandlerCallDetails', - 'GenericRpcHandler', - 'ServiceRpcHandler', - 'Server', - 'unary_unary_rpc_method_handler', - 'unary_stream_rpc_method_handler', + 'FutureTimeoutError', 'FutureCancelledError', 'Future', + 'ChannelConnectivity', 'StatusCode', 'RpcError', 'RpcContext', + 'Call', 'ChannelCredentials', 'CallCredentials', + 'AuthMetadataContext', 'AuthMetadataPluginCallback', + 'AuthMetadataPlugin', 'ServerCredentials', + 'UnaryUnaryMultiCallable', 'UnaryStreamMultiCallable', + 'StreamUnaryMultiCallable', 'StreamStreamMultiCallable', 'Channel', + 'ServicerContext', 'RpcMethodHandler', 'HandlerCallDetails', + 'GenericRpcHandler', 'ServiceRpcHandler', 'Server', + 'unary_unary_rpc_method_handler', 'unary_stream_rpc_method_handler', 'stream_unary_rpc_method_handler', 'stream_stream_rpc_method_handler', - 'method_handlers_generic_handler', - 'ssl_channel_credentials', - 'metadata_call_credentials', - 'access_token_call_credentials', - 'composite_call_credentials', - 'composite_channel_credentials', - 'ssl_server_credentials', - 'channel_ready_future', - 'insecure_channel', - 'secure_channel', - 'server',) + 'method_handlers_generic_handler', 'ssl_channel_credentials', + 'metadata_call_credentials', 'access_token_call_credentials', + 'composite_call_credentials', 'composite_channel_credentials', + 'ssl_server_credentials', 'channel_ready_future', + 'insecure_channel', 'secure_channel', 'server',) six.assertCountEqual(self, expected_grpc_code_elements, _from_grpc_import_star.GRPC_ELEMENTS) @@ -89,13 +66,12 @@ class AllTest(unittest.TestCase): class ChannelConnectivityTest(unittest.TestCase): def testChannelConnectivity(self): - self.assertSequenceEqual(( - grpc.ChannelConnectivity.IDLE, - grpc.ChannelConnectivity.CONNECTING, - grpc.ChannelConnectivity.READY, - grpc.ChannelConnectivity.TRANSIENT_FAILURE, - grpc.ChannelConnectivity.SHUTDOWN,), - tuple(grpc.ChannelConnectivity)) + self.assertSequenceEqual( + (grpc.ChannelConnectivity.IDLE, grpc.ChannelConnectivity.CONNECTING, + grpc.ChannelConnectivity.READY, + grpc.ChannelConnectivity.TRANSIENT_FAILURE, + grpc.ChannelConnectivity.SHUTDOWN,), + tuple(grpc.ChannelConnectivity)) class ChannelTest(unittest.TestCase): diff --git a/src/python/grpcio_tests/tests/unit/_channel_args_test.py b/src/python/grpcio_tests/tests/unit/_channel_args_test.py index 845db777a4c..4ff8f1a1868 100644 --- a/src/python/grpcio_tests/tests/unit/_channel_args_test.py +++ b/src/python/grpcio_tests/tests/unit/_channel_args_test.py @@ -39,12 +39,8 @@ class TestPointerWrapper(object): return 123456 -TEST_CHANNEL_ARGS = ( - ('arg1', b'bytes_val'), - ('arg2', 'str_val'), - ('arg3', 1), - (b'arg4', 'str_val'), - ('arg6', TestPointerWrapper()),) +TEST_CHANNEL_ARGS = (('arg1', b'bytes_val'), ('arg2', 'str_val'), ('arg3', 1), + (b'arg4', 'str_val'), ('arg6', TestPointerWrapper()),) class ChannelArgsTest(unittest.TestCase): diff --git a/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py b/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py index d77f5ecb27e..ee7a16ad008 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py @@ -167,11 +167,8 @@ class CancelManyCallsTest(unittest.TestCase): state = _State() - server_thread_args = ( - state, - server, - server_completion_queue, - server_thread_pool,) + server_thread_args = (state, server, server_completion_queue, + server_thread_pool,) server_thread = threading.Thread(target=_serve, args=server_thread_args) server_thread.start() diff --git a/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py b/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py index 5c7f9030151..81307af7702 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py @@ -71,9 +71,7 @@ class ChannelTest(unittest.TestCase): def test_single_channel_lonely_connectivity(self): channel, completion_queue = _channel_and_completion_queue() - _in_parallel(_connectivity_loop, ( - channel, - completion_queue,)) + _in_parallel(_connectivity_loop, (channel, completion_queue,)) completion_queue.shutdown() def test_multiple_channels_lonely_connectivity(self): diff --git a/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py b/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py index 9fbfcbb9c02..2cc8aeef6d8 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py @@ -151,11 +151,9 @@ class ReadSomeButNotAllResponsesTest(unittest.TestCase): server_send_first_message_tag = 'server_send_first_message_tag' server_send_second_message_tag = 'server_send_second_message_tag' server_complete_rpc_tag = 'server_complete_rpc_tag' - server_call_due = set(( - server_send_initial_metadata_tag, - server_send_first_message_tag, - server_send_second_message_tag, - server_complete_rpc_tag,)) + server_call_due = set( + (server_send_initial_metadata_tag, server_send_first_message_tag, + server_send_second_message_tag, server_complete_rpc_tag,)) server_call_completion_queue = cygrpc.CompletionQueue() server_call_driver = _QueueDriver(server_call_condition, server_call_completion_queue, diff --git a/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py b/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py index efeb237874f..f2e3898ed6f 100644 --- a/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py +++ b/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py @@ -77,9 +77,7 @@ class _Handler(object): def handle_unary_unary(self, request, servicer_context): self._control.control() if servicer_context is not None: - servicer_context.set_trailing_metadata((( - 'testkey', - 'testvalue',),)) + servicer_context.set_trailing_metadata((('testkey', 'testvalue',),)) return request def handle_unary_stream(self, request, servicer_context): @@ -88,9 +86,7 @@ class _Handler(object): yield request self._control.control() if servicer_context is not None: - servicer_context.set_trailing_metadata((( - 'testkey', - 'testvalue',),)) + servicer_context.set_trailing_metadata((('testkey', 'testvalue',),)) def handle_stream_unary(self, request_iterator, servicer_context): if servicer_context is not None: @@ -102,17 +98,13 @@ class _Handler(object): response_elements.append(request) self._control.control() if servicer_context is not None: - servicer_context.set_trailing_metadata((( - 'testkey', - 'testvalue',),)) + servicer_context.set_trailing_metadata((('testkey', 'testvalue',),)) return b''.join(response_elements) def handle_stream_stream(self, request_iterator, servicer_context): self._control.control() if servicer_context is not None: - servicer_context.set_trailing_metadata((( - 'testkey', - 'testvalue',),)) + servicer_context.set_trailing_metadata((('testkey', 'testvalue',),)) for request in request_iterator: self._control.control() yield request diff --git a/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py b/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py index af2ce64dcea..a2cccfc7014 100644 --- a/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py +++ b/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py @@ -164,7 +164,8 @@ class _Servicer(object): def _generic_handler(servicer): method_handlers = { - _UNARY_UNARY: grpc.unary_unary_rpc_method_handler( + _UNARY_UNARY: + grpc.unary_unary_rpc_method_handler( servicer.unary_unary, request_deserializer=_REQUEST_DESERIALIZER, response_serializer=_RESPONSE_SERIALIZER), @@ -172,7 +173,8 @@ def _generic_handler(servicer): grpc.unary_stream_rpc_method_handler(servicer.unary_stream), _STREAM_UNARY: grpc.stream_unary_rpc_method_handler(servicer.stream_unary), - _STREAM_STREAM: grpc.stream_stream_rpc_method_handler( + _STREAM_STREAM: + grpc.stream_stream_rpc_method_handler( servicer.stream_stream, request_deserializer=_REQUEST_DESERIALIZER, response_serializer=_RESPONSE_SERIALIZER), @@ -192,25 +194,15 @@ class MetadataCodeDetailsTest(unittest.TestCase): channel = grpc.insecure_channel('localhost:{}'.format(port)) self._unary_unary = channel.unary_unary( - '/'.join(( - '', - _SERVICE, - _UNARY_UNARY,)), + '/'.join(('', _SERVICE, _UNARY_UNARY,)), request_serializer=_REQUEST_SERIALIZER, response_deserializer=_RESPONSE_DESERIALIZER,) - self._unary_stream = channel.unary_stream('/'.join(( - '', - _SERVICE, - _UNARY_STREAM,)),) - self._stream_unary = channel.stream_unary('/'.join(( - '', - _SERVICE, - _STREAM_UNARY,)),) + self._unary_stream = channel.unary_stream( + '/'.join(('', _SERVICE, _UNARY_STREAM,)),) + self._stream_unary = channel.stream_unary( + '/'.join(('', _SERVICE, _STREAM_UNARY,)),) self._stream_stream = channel.stream_stream( - '/'.join(( - '', - _SERVICE, - _STREAM_STREAM,)), + '/'.join(('', _SERVICE, _STREAM_STREAM,)), request_serializer=_REQUEST_SERIALIZER, response_deserializer=_RESPONSE_DESERIALIZER,) diff --git a/src/python/grpcio_tests/tests/unit/_rpc_test.py b/src/python/grpcio_tests/tests/unit/_rpc_test.py index 2b1c85a82d2..0bfcfc58a1e 100644 --- a/src/python/grpcio_tests/tests/unit/_rpc_test.py +++ b/src/python/grpcio_tests/tests/unit/_rpc_test.py @@ -78,9 +78,7 @@ class _Handler(object): def handle_unary_unary(self, request, servicer_context): self._control.control() if servicer_context is not None: - servicer_context.set_trailing_metadata((( - 'testkey', - 'testvalue',),)) + servicer_context.set_trailing_metadata((('testkey', 'testvalue',),)) # TODO(https://github.com/grpc/grpc/issues/8483): test the values # returned by these methods rather than only "smoke" testing that # the return after having been called. @@ -94,9 +92,7 @@ class _Handler(object): yield request self._control.control() if servicer_context is not None: - servicer_context.set_trailing_metadata((( - 'testkey', - 'testvalue',),)) + servicer_context.set_trailing_metadata((('testkey', 'testvalue',),)) def handle_stream_unary(self, request_iterator, servicer_context): if servicer_context is not None: @@ -108,17 +104,13 @@ class _Handler(object): response_elements.append(request) self._control.control() if servicer_context is not None: - servicer_context.set_trailing_metadata((( - 'testkey', - 'testvalue',),)) + servicer_context.set_trailing_metadata((('testkey', 'testvalue',),)) return b''.join(response_elements) def handle_stream_stream(self, request_iterator, servicer_context): self._control.control() if servicer_context is not None: - servicer_context.set_trailing_metadata((( - 'testkey', - 'testvalue',),)) + servicer_context.set_trailing_metadata((('testkey', 'testvalue',),)) for request in request_iterator: self._control.control() yield request diff --git a/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py b/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py index b5fdac26c11..7d6df5bb5ba 100644 --- a/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py +++ b/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py @@ -177,9 +177,9 @@ class BetaFeaturesTest(unittest.TestCase): thread_pool_size=test_constants.POOL_SIZE) self._server = implementations.server( method_implementations, options=server_options) - server_credentials = implementations.ssl_server_credentials([( - resources.private_key(), - resources.certificate_chain(),),]) + server_credentials = implementations.ssl_server_credentials([ + (resources.private_key(), resources.certificate_chain(),), + ]) port = self._server.add_secure_port('[::]:0', server_credentials) self._server.start() self._channel_credentials = implementations.ssl_channel_credentials( @@ -303,9 +303,9 @@ class ContextManagementAndLifecycleTest(unittest.TestCase): self._server_options = implementations.server_options( thread_pool_size=test_constants.POOL_SIZE) - self._server_credentials = implementations.ssl_server_credentials([( - resources.private_key(), - resources.certificate_chain(),),]) + self._server_credentials = implementations.ssl_server_credentials([ + (resources.private_key(), resources.certificate_chain(),), + ]) self._channel_credentials = implementations.ssl_channel_credentials( resources.test_root_certificates()) self._stub_options = implementations.stub_options( diff --git a/src/python/grpcio_tests/tests/unit/beta/_face_interface_test.py b/src/python/grpcio_tests/tests/unit/beta/_face_interface_test.py index f4214426241..e35a12cf62a 100644 --- a/src/python/grpcio_tests/tests/unit/beta/_face_interface_test.py +++ b/src/python/grpcio_tests/tests/unit/beta/_face_interface_test.py @@ -47,10 +47,8 @@ _SERVER_HOST_OVERRIDE = 'foo.test.google.fr' class _SerializationBehaviors( collections.namedtuple('_SerializationBehaviors', ( - 'request_serializers', - 'request_deserializers', - 'response_serializers', - 'response_deserializers',))): + 'request_serializers', 'request_deserializers', + 'response_serializers', 'response_deserializers',))): pass @@ -89,9 +87,9 @@ class _Implementation(test_interfaces.Implementation): thread_pool_size=test_constants.POOL_SIZE) server = implementations.server( method_implementations, options=server_options) - server_credentials = implementations.ssl_server_credentials([( - resources.private_key(), - resources.certificate_chain(),),]) + server_credentials = implementations.ssl_server_credentials([ + (resources.private_key(), resources.certificate_chain(),), + ]) port = server.add_secure_port('[::]:0', server_credentials) server.start() channel_credentials = implementations.ssl_channel_credentials( diff --git a/src/python/grpcio_tests/tests/unit/beta/test_utilities.py b/src/python/grpcio_tests/tests/unit/beta/test_utilities.py index f5424206837..78b4622a879 100644 --- a/src/python/grpcio_tests/tests/unit/beta/test_utilities.py +++ b/src/python/grpcio_tests/tests/unit/beta/test_utilities.py @@ -48,7 +48,6 @@ def not_really_secure_channel(host, port, channel_credentials, conducted. """ target = '%s:%d' % (host, port) - channel = grpc.secure_channel(target, channel_credentials, (( - 'grpc.ssl_target_name_override', - server_host_override,),)) + channel = grpc.secure_channel(target, channel_credentials, ( + ('grpc.ssl_target_name_override', server_host_override,),)) return implementations.Channel(channel) diff --git a/src/python/grpcio_tests/tests/unit/framework/interfaces/face/_digest.py b/src/python/grpcio_tests/tests/unit/framework/interfaces/face/_digest.py index 0411da0a667..cc4855cc334 100644 --- a/src/python/grpcio_tests/tests/unit/framework/interfaces/face/_digest.py +++ b/src/python/grpcio_tests/tests/unit/framework/interfaces/face/_digest.py @@ -49,12 +49,9 @@ _IDENTITY = lambda x: x class TestServiceDigest( collections.namedtuple('TestServiceDigest', ( - 'methods', - 'inline_method_implementations', - 'event_method_implementations', - 'multi_method_implementation', - 'unary_unary_messages_sequences', - 'unary_stream_messages_sequences', + 'methods', 'inline_method_implementations', + 'event_method_implementations', 'multi_method_implementation', + 'unary_unary_messages_sequences', 'unary_stream_messages_sequences', 'stream_unary_messages_sequences', 'stream_stream_messages_sequences',))): """A transformation of a service.TestService. diff --git a/src/python/grpcio_tests/tests/unit/framework/interfaces/face/_invocation.py b/src/python/grpcio_tests/tests/unit/framework/interfaces/face/_invocation.py index 4e144a36352..6afbd2b5be5 100644 --- a/src/python/grpcio_tests/tests/unit/framework/interfaces/face/_invocation.py +++ b/src/python/grpcio_tests/tests/unit/framework/interfaces/face/_invocation.py @@ -206,7 +206,5 @@ def invoker_constructors(): Returns: A sequence of InvokerConstructors. """ - return ( - _GenericInvokerConstructor(), - _MultiCallableInvokerConstructor(), - _DynamicInvokerConstructor(),) + return (_GenericInvokerConstructor(), _MultiCallableInvokerConstructor(), + _DynamicInvokerConstructor(),) diff --git a/src/python/grpcio_tests/tests/unit/test_common.py b/src/python/grpcio_tests/tests/unit/test_common.py index 00fbe0567a2..4b3ba911b99 100644 --- a/src/python/grpcio_tests/tests/unit/test_common.py +++ b/src/python/grpcio_tests/tests/unit/test_common.py @@ -33,18 +33,9 @@ import collections import grpc import six -INVOCATION_INITIAL_METADATA = ( - ('0', 'abc'), - ('1', 'def'), - ('2', 'ghi'),) -SERVICE_INITIAL_METADATA = ( - ('3', 'jkl'), - ('4', 'mno'), - ('5', 'pqr'),) -SERVICE_TERMINAL_METADATA = ( - ('6', 'stu'), - ('7', 'vwx'), - ('8', 'yza'),) +INVOCATION_INITIAL_METADATA = (('0', 'abc'), ('1', 'def'), ('2', 'ghi'),) +SERVICE_INITIAL_METADATA = (('3', 'jkl'), ('4', 'mno'), ('5', 'pqr'),) +SERVICE_TERMINAL_METADATA = (('6', 'stu'), ('7', 'vwx'), ('8', 'yza'),) DETAILS = 'test details' @@ -103,7 +94,6 @@ def test_secure_channel(target, channel_credentials, server_host_override): An implementations.Channel to the remote host through which RPCs may be conducted. """ - channel = grpc.secure_channel(target, channel_credentials, (( - 'grpc.ssl_target_name_override', - server_host_override,),)) + channel = grpc.secure_channel(target, channel_credentials, ( + ('grpc.ssl_target_name_override', server_host_override,),)) return channel diff --git a/tools/distrib/yapf_code.sh b/tools/distrib/yapf_code.sh index e3ebf1c4908..030412ebeb9 100755 --- a/tools/distrib/yapf_code.sh +++ b/tools/distrib/yapf_code.sh @@ -40,7 +40,8 @@ VIRTUALENV=python_format_venv virtualenv $VIRTUALENV PYTHON=`realpath $VIRTUALENV/bin/python` -$PYTHON -m pip install --upgrade futures yapf +$PYTHON -m pip install futures +$PYTHON -m pip install yapf==0.16.0 exclusion_args="" for exclusion in $EXCLUSIONS; do From ed20a699390b4f904055fcbd5f8cf33f67cbf107 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 6 Feb 2017 13:42:58 -0800 Subject: [PATCH 09/11] Resolve generate_project failure --- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 98024a700b4..1b9175bece5 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -37,7 +37,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.1.0-dev' + version = '1.2.0-dev' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 85947a7176b..33ad74d2dfc 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.1.0-dev' + version = '1.2.0-dev' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 293b90d0040..35eb5587c85 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.1.0-dev' + version = '1.2.0-dev' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'http://www.grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 04f228e16ef..6ba0c01d39f 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -35,7 +35,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.1.0-dev' + version = '1.2.0-dev' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'http://www.grpc.io' diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index cbe8f4b6072..3429e2b29bd 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.1.0-dev' + v = '1.2.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index bbb02d61bd6..e569faa25bb 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -38,4 +38,4 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.1.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.2.0-dev" From e5cf8f0ee0d5915e4c37a560106010e9e6f9b396 Mon Sep 17 00:00:00 2001 From: Wenbo Zhu Date: Mon, 6 Feb 2017 14:23:03 -0800 Subject: [PATCH 10/11] Update PROTOCOL-WEB.md 1. Clarify about trailer-only responses 2. Switch to http/1.1 header block format for in-body trailer encoding 3. Clarify how compatibility is supported (using U-A and Server headers respectively) --- doc/PROTOCOL-WEB.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/PROTOCOL-WEB.md b/doc/PROTOCOL-WEB.md index 562d5999cf5..0fc1899b383 100644 --- a/doc/PROTOCOL-WEB.md +++ b/doc/PROTOCOL-WEB.md @@ -60,14 +60,14 @@ HTTP/2 related behavior (specified in [gRPC over HTTP2](http://www.grpc.io/docs/ Message framing (vs. [http2-transport-mapping](http://www.grpc.io/docs/guides/wire.html#http2-transport-mapping)) 1. Response status encoded as part of the response body - * Key-value pairs encoded in the HTTP/2 [literal header format](https://tools.ietf.org/html/rfc7541#section-6.2) as a single header block. + * Key-value pairs encoded as a HTTP/1 headers block (without the terminating newline). 2. 8th (MSB) bit of the 1st gRPC frame byte * 0: data * 1: trailers 3. Trailers must be the last message of the response, as enforced by the implementation 4. Trailers-only responses: no change to the gRPC protocol spec. -Trailers will be sent together with response headers, with no message +Trailers may be sent together with response headers, with no message in the body. --- From 7b6ad2d508394db91680a92fbbf868d624e3a61b Mon Sep 17 00:00:00 2001 From: Wenbo Zhu Date: Mon, 6 Feb 2017 14:26:32 -0800 Subject: [PATCH 11/11] Update PROTOCOL-WEB.md Mention the Server header format --- doc/PROTOCOL-WEB.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/PROTOCOL-WEB.md b/doc/PROTOCOL-WEB.md index 0fc1899b383..35448d683f2 100644 --- a/doc/PROTOCOL-WEB.md +++ b/doc/PROTOCOL-WEB.md @@ -72,9 +72,10 @@ in the body. --- -User Agent +User Agent and Server headers -* grpc-web-javascript/0.1 +* U-A: grpc-web-javascript/0.1 +* Server: grpc-web-gateway/0.1 ---