diff options
author | Julien Boeuf <jboeuf@google.com> | 2015-08-03 15:44:09 -0700 |
---|---|---|
committer | Julien Boeuf <jboeuf@google.com> | 2015-08-03 15:44:09 -0700 |
commit | 095f4f955957005969981e365bed12ae35f58acf (patch) | |
tree | 16ddc348a6bd217d7ee2aa8def1e23e2878f780f /src | |
parent | 0945420b348176fa176f2fd544e430ecedaa182c (diff) | |
parent | bdd3c90ffaff4d80f06336eef4844ac188d4c623 (diff) |
Merge branch 'master' of github.com:grpc/grpc into auth_md_processor
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/generator_helpers.h | 8 | ||||
-rw-r--r-- | src/core/channel/http_client_filter.c | 44 | ||||
-rw-r--r-- | src/core/channel/http_server_filter.c | 10 | ||||
-rw-r--r-- | src/core/client_config/resolvers/dns_resolver.c | 16 | ||||
-rw-r--r-- | src/core/client_config/subchannel_factory_decorators/add_channel_arg.c | 43 | ||||
-rw-r--r-- | src/core/client_config/subchannel_factory_decorators/add_channel_arg.h | 45 | ||||
-rw-r--r-- | src/core/client_config/subchannel_factory_decorators/merge_channel_args.c | 84 | ||||
-rw-r--r-- | src/core/client_config/subchannel_factory_decorators/merge_channel_args.h | 45 | ||||
-rw-r--r-- | src/core/iomgr/fd_posix.c | 6 | ||||
-rw-r--r-- | src/core/iomgr/fd_posix.h | 1 | ||||
-rw-r--r-- | src/core/iomgr/tcp_server_posix.c | 2 | ||||
-rw-r--r-- | src/core/iomgr/tcp_windows.c | 6 | ||||
-rw-r--r-- | src/core/support/stack_lockfree.c | 12 | ||||
-rw-r--r-- | src/core/surface/channel.c | 18 | ||||
-rw-r--r-- | src/core/surface/channel_connectivity.c | 8 | ||||
-rw-r--r-- | src/core/surface/server.c | 11 | ||||
-rw-r--r-- | src/core/transport/chttp2/alpn.c | 3 | ||||
-rw-r--r-- | src/cpp/client/client_context.cc | 11 | ||||
-rw-r--r-- | src/cpp/server/server_context.cc | 11 | ||||
-rw-r--r-- | src/node/examples/math_server.js | 2 | ||||
-rw-r--r-- | src/node/examples/route_guide_server.js | 2 | ||||
-rw-r--r-- | src/node/examples/stock_server.js | 2 | ||||
-rw-r--r-- | src/node/ext/server.cc | 44 | ||||
-rw-r--r-- | src/node/ext/server.h | 1 | ||||
-rw-r--r-- | src/node/ext/server_credentials.cc | 18 | ||||
-rw-r--r-- | src/node/ext/server_credentials.h | 1 | ||||
-rw-r--r-- | src/node/interop/interop_server.js | 4 | ||||
-rw-r--r-- | src/node/src/server.js | 6 | ||||
-rw-r--r-- | src/node/test/call_test.js | 3 | ||||
-rw-r--r-- | src/node/test/end_to_end_test.js | 3 | ||||
-rw-r--r-- | src/node/test/health_test.js | 3 | ||||
-rw-r--r-- | src/node/test/math_client_test.js | 3 | ||||
-rw-r--r-- | src/node/test/server_test.js | 19 | ||||
-rw-r--r-- | src/node/test/surface_test.js | 12 | ||||
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.m | 14 | ||||
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCCompletionQueue.h | 18 | ||||
-rw-r--r-- | src/python/grpcio/.gitignore (renamed from src/python/src/.gitignore) | 2 | ||||
-rw-r--r-- | src/python/grpcio/MANIFEST.in (renamed from src/python/src/MANIFEST.in) | 1 | ||||
-rw-r--r-- | src/python/grpcio/README.rst (renamed from src/python/src/README.rst) | 0 | ||||
-rw-r--r-- | src/python/grpcio/commands.py (renamed from src/python/src/commands.py) | 1 | ||||
-rw-r--r-- | src/python/grpcio/grpc/__init__.py (renamed from src/python/interop/interop/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/.gitignore (renamed from src/python/src/grpc/_adapter/.gitignore) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/__init__.py (renamed from src/python/src/grpc/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/module.c (renamed from src/python/src/grpc/_adapter/_c/module.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types.c (renamed from src/python/src/grpc/_adapter/_c/types.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types.h (renamed from src/python/src/grpc/_adapter/_c/types.h) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types/call.c (renamed from src/python/src/grpc/_adapter/_c/types/call.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types/channel.c (renamed from src/python/src/grpc/_adapter/_c/types/channel.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types/client_credentials.c (renamed from src/python/src/grpc/_adapter/_c/types/client_credentials.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types/completion_queue.c (renamed from src/python/src/grpc/_adapter/_c/types/completion_queue.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types/server.c (renamed from src/python/src/grpc/_adapter/_c/types/server.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types/server_credentials.c (renamed from src/python/src/grpc/_adapter/_c/types/server_credentials.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/utility.c (renamed from src/python/src/grpc/_adapter/_c/utility.c) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_common.py (renamed from src/python/src/grpc/_adapter/_common.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_intermediary_low.py (renamed from src/python/src/grpc/_adapter/_intermediary_low.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_low.py (renamed from src/python/src/grpc/_adapter/_low.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_types.py (renamed from src/python/src/grpc/_adapter/_types.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/fore.py (renamed from src/python/src/grpc/_adapter/fore.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/rear.py (renamed from src/python/src/grpc/_adapter/rear.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/.gitignore (renamed from src/python/src/grpc/_cython/.gitignore) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/README.rst (renamed from src/python/src/grpc/_cython/README.rst) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/__init__.py (renamed from src/python/src/grpc/_cython/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/__init__.py (renamed from src/python/src/grpc/_cython/_cygrpc/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/call.pxd (renamed from src/python/src/grpc/_cython/_cygrpc/call.pxd) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/call.pyx (renamed from src/python/src/grpc/_cython/_cygrpc/call.pyx) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd (renamed from src/python/src/grpc/_cython/_cygrpc/channel.pxd) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx (renamed from src/python/src/grpc/_cython/_cygrpc/channel.pyx) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd (renamed from src/python/src/grpc/_cython/_cygrpc/completion_queue.pxd) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx (renamed from src/python/src/grpc/_cython/_cygrpc/completion_queue.pyx) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd (renamed from src/python/src/grpc/_cython/_cygrpc/credentials.pxd) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx (renamed from src/python/src/grpc/_cython/_cygrpc/credentials.pyx) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxd (renamed from src/python/src/grpc/_cython/_cygrpc/grpc.pxd) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/records.pxd (renamed from src/python/src/grpc/_cython/_cygrpc/records.pxd) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/records.pyx (renamed from src/python/src/grpc/_cython/_cygrpc/records.pyx) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/server.pxd (renamed from src/python/src/grpc/_cython/_cygrpc/server.pxd) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/server.pyx (renamed from src/python/src/grpc/_cython/_cygrpc/server.pyx) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/adapter_low.py (renamed from src/python/src/grpc/_cython/adapter_low.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/cygrpc.pyx (renamed from src/python/src/grpc/_cython/cygrpc.pyx) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_links/__init__.py (renamed from src/python/src/grpc/_adapter/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_links/invocation.py (renamed from src/python/src/grpc/_links/invocation.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_links/service.py (renamed from src/python/src/grpc/_links/service.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/early_adopter/__init__.py (renamed from src/python/src/grpc/_junkdrawer/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/early_adopter/implementations.py (renamed from src/python/src/grpc/early_adopter/implementations.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/__init__.py (renamed from src/python/src/grpc/_links/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/alpha/__init__.py (renamed from src/python/src/grpc/framework/alpha/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/alpha/_face_utilities.py (renamed from src/python/src/grpc/framework/alpha/_face_utilities.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/alpha/_reexport.py (renamed from src/python/src/grpc/framework/alpha/_reexport.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/alpha/exceptions.py (renamed from src/python/src/grpc/framework/alpha/exceptions.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/alpha/interfaces.py (renamed from src/python/src/grpc/framework/alpha/interfaces.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/alpha/utilities.py (renamed from src/python/src/grpc/framework/alpha/utilities.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/__init__.py (renamed from src/python/src/grpc/early_adopter/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_cancellation.py (renamed from src/python/src/grpc/framework/base/_cancellation.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_constants.py (renamed from src/python/src/grpc/framework/base/_constants.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_context.py (renamed from src/python/src/grpc/framework/base/_context.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_emission.py (renamed from src/python/src/grpc/framework/base/_emission.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_ends.py (renamed from src/python/src/grpc/framework/base/_ends.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_expiration.py (renamed from src/python/src/grpc/framework/base/_expiration.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_ingestion.py (renamed from src/python/src/grpc/framework/base/_ingestion.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_interfaces.py (renamed from src/python/src/grpc/framework/base/_interfaces.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_reception.py (renamed from src/python/src/grpc/framework/base/_reception.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_termination.py (renamed from src/python/src/grpc/framework/base/_termination.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/_transmission.py (renamed from src/python/src/grpc/framework/base/_transmission.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/exceptions.py (renamed from src/python/src/grpc/framework/base/exceptions.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/implementations.py (renamed from src/python/src/grpc/framework/base/implementations.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/in_memory.py (renamed from src/python/src/grpc/framework/base/in_memory.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/interfaces.py (renamed from src/python/src/grpc/framework/base/interfaces.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/null.py (renamed from src/python/src/grpc/framework/base/null.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/base/util.py (renamed from src/python/src/grpc/framework/base/util.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/common/__init__.py (renamed from src/python/src/grpc/framework/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/common/cardinality.py (renamed from src/python/src/grpc/framework/common/cardinality.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/common/style.py (renamed from src/python/src/grpc/framework/common/style.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/__init__.py (renamed from src/python/src/grpc/framework/base/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/_calls.py (renamed from src/python/src/grpc/framework/face/_calls.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/_control.py (renamed from src/python/src/grpc/framework/face/_control.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/_service.py (renamed from src/python/src/grpc/framework/face/_service.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/demonstration.py (renamed from src/python/src/grpc/framework/face/demonstration.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/exceptions.py (renamed from src/python/src/grpc/framework/face/exceptions.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/implementations.py (renamed from src/python/src/grpc/framework/face/implementations.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/interfaces.py (renamed from src/python/src/grpc/framework/face/interfaces.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/face/utilities.py (renamed from src/python/src/grpc/framework/face/utilities.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/__init__.py (renamed from src/python/src/grpc/framework/common/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/_timer_future.py (renamed from src/python/src/grpc/framework/foundation/_timer_future.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/abandonment.py (renamed from src/python/src/grpc/framework/foundation/abandonment.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/activated.py (renamed from src/python/src/grpc/framework/foundation/activated.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/callable_util.py (renamed from src/python/src/grpc/framework/foundation/callable_util.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/future.py (renamed from src/python/src/grpc/framework/foundation/future.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/later.py (renamed from src/python/src/grpc/framework/foundation/later.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/logging_pool.py (renamed from src/python/src/grpc/framework/foundation/logging_pool.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/relay.py (renamed from src/python/src/grpc/framework/foundation/relay.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/stream.py (renamed from src/python/src/grpc/framework/foundation/stream.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/stream_util.py (renamed from src/python/src/grpc/framework/foundation/stream_util.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/interfaces/__init__.py (renamed from src/python/src/grpc/framework/face/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/interfaces/links/__init__.py (renamed from src/python/src/grpc/framework/face/testing/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/interfaces/links/links.py (renamed from src/python/src/grpc/framework/interfaces/links/links.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/grpc/framework/interfaces/links/utilities.py (renamed from src/python/src/grpc/framework/interfaces/links/utilities.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio/requirements.txt (renamed from src/python/requirements.txt) | 0 | ||||
-rw-r--r-- | src/python/grpcio/setup.cfg (renamed from src/python/src/setup.cfg) | 0 | ||||
-rw-r--r-- | src/python/grpcio/setup.py (renamed from src/python/src/setup.py) | 26 | ||||
-rw-r--r-- | src/python/grpcio_test/.gitignore | 10 | ||||
-rw-r--r-- | src/python/grpcio_test/MANIFEST.in | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/commands.py | 57 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/__init__.py (renamed from src/python/src/grpc/framework/foundation/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/_insecure_interop_test.py (renamed from src/python/interop/interop/_insecure_interop_test.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/_interop_test_case.py (renamed from src/python/interop/interop/_interop_test_case.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/_secure_interop_test.py (renamed from src/python/interop/interop/_secure_interop_test.py) | 6 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/client.py (renamed from src/python/interop/interop/client.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/credentials/README (renamed from src/python/interop/interop/credentials/README) | 0 | ||||
-rwxr-xr-x | src/python/grpcio_test/grpc_interop/credentials/ca.pem (renamed from src/python/interop/interop/credentials/ca.pem) | 0 | ||||
-rwxr-xr-x | src/python/grpcio_test/grpc_interop/credentials/server1.key (renamed from src/python/interop/interop/credentials/server1.key) | 0 | ||||
-rwxr-xr-x | src/python/grpcio_test/grpc_interop/credentials/server1.pem (renamed from src/python/interop/interop/credentials/server1.pem) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/empty_pb2.py (renamed from src/python/interop/interop/empty_pb2.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/messages_pb2.py (renamed from src/python/interop/interop/messages_pb2.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/methods.py (renamed from src/python/interop/interop/methods.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/resources.py (renamed from src/python/interop/interop/resources.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/server.py (renamed from src/python/interop/interop/server.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_interop/test_pb2.py (renamed from src/python/interop/interop/test_pb2.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/__init__.py (renamed from src/python/src/grpc/framework/interfaces/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/.gitignore | 5 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/__init__.py (renamed from src/python/src/grpc/framework/interfaces/links/__init__.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_blocking_invocation_inline_service_test.py (renamed from src/python/src/grpc/_adapter/_blocking_invocation_inline_service_test.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_c_test.py (renamed from src/python/src/grpc/_adapter/_c_test.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_event_invocation_synchronous_event_service_test.py (renamed from src/python/src/grpc/_adapter/_event_invocation_synchronous_event_service_test.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_face_test_case.py (renamed from src/python/src/grpc/_adapter/_face_test_case.py) | 6 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_future_invocation_asynchronous_event_service_test.py (renamed from src/python/src/grpc/_adapter/_future_invocation_asynchronous_event_service_test.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_intermediary_low_test.py (renamed from src/python/src/grpc/_adapter/_intermediary_low_test.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_links_test.py (renamed from src/python/src/grpc/_adapter/_links_test.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_lonely_rear_link_test.py (renamed from src/python/src/grpc/_adapter/_lonely_rear_link_test.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_low_test.py (renamed from src/python/src/grpc/_adapter/_low_test.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_proto_scenarios.py (renamed from src/python/src/grpc/_adapter/_proto_scenarios.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_adapter/_test_links.py (renamed from src/python/src/grpc/_adapter/_test_links.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_cython/.gitignore | 7 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_cython/__init__.py | 28 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_cython/adapter_low_test.py (renamed from src/python/src/grpc/_cython/adapter_low_test.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_cython/cygrpc_test.py (renamed from src/python/src/grpc/_cython/cygrpc_test.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_cython/test_utilities.py (renamed from src/python/src/grpc/_cython/test_utilities.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_junkdrawer/__init__.py (renamed from src/python/interop/setup.py) | 27 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_junkdrawer/math_pb2.py (renamed from src/python/src/grpc/_junkdrawer/math_pb2.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_junkdrawer/stock_pb2.py (renamed from src/python/src/grpc/_junkdrawer/stock_pb2.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_links/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_links/_lonely_invocation_link_test.py (renamed from src/python/src/grpc/_links/_lonely_invocation_link_test.py) | 6 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_links/_proto_scenarios.py (renamed from src/python/src/grpc/_links/_proto_scenarios.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/_links/_transmission_test.py (renamed from src/python/src/grpc/_links/_transmission_test.py) | 8 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/early_adopter/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/early_adopter/implementations_test.py (renamed from src/python/src/grpc/early_adopter/implementations_test.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/base/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/base/implementations_test.py (renamed from src/python/src/grpc/framework/base/implementations_test.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/base/interfaces_test_case.py (renamed from src/python/src/grpc/framework/base/interfaces_test_case.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/common/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/common/test_constants.py (renamed from src/python/src/grpc/framework/common/test_constants.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/common/test_control.py (renamed from src/python/src/grpc/framework/common/test_control.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/common/test_coverage.py (renamed from src/python/src/grpc/framework/common/test_coverage.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/_test_case.py (renamed from src/python/src/grpc/framework/face/_test_case.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/blocking_invocation_inline_service_test.py (renamed from src/python/src/grpc/framework/face/blocking_invocation_inline_service_test.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/event_invocation_synchronous_event_service_test.py (renamed from src/python/src/grpc/framework/face/event_invocation_synchronous_event_service_test.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/future_invocation_asynchronous_event_service_test.py (renamed from src/python/src/grpc/framework/face/future_invocation_asynchronous_event_service_test.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/base_util.py (renamed from src/python/src/grpc/framework/face/testing/base_util.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/blocking_invocation_inline_service_test_case.py (renamed from src/python/src/grpc/framework/face/testing/blocking_invocation_inline_service_test_case.py) | 10 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/callback.py (renamed from src/python/src/grpc/framework/face/testing/callback.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/control.py (renamed from src/python/src/grpc/framework/face/testing/control.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/coverage.py (renamed from src/python/src/grpc/framework/face/testing/coverage.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/digest.py (renamed from src/python/src/grpc/framework/face/testing/digest.py) | 6 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/event_invocation_synchronous_event_service_test_case.py (renamed from src/python/src/grpc/framework/face/testing/event_invocation_synchronous_event_service_test_case.py) | 12 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py (renamed from src/python/src/grpc/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py) | 10 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/interfaces.py (renamed from src/python/src/grpc/framework/face/testing/interfaces.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/serial.py (renamed from src/python/src/grpc/framework/face/testing/serial.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/service.py (renamed from src/python/src/grpc/framework/face/testing/service.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/stock_service.py (renamed from src/python/src/grpc/framework/face/testing/stock_service.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/face/testing/test_case.py (renamed from src/python/src/grpc/framework/face/testing/test_case.py) | 2 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/foundation/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/foundation/_later_test.py (renamed from src/python/src/grpc/framework/foundation/_later_test.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/foundation/_logging_pool_test.py (renamed from src/python/src/grpc/framework/foundation/_logging_pool_test.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/foundation/stream_testing.py (renamed from src/python/src/grpc/framework/foundation/stream_testing.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/interfaces/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/interfaces/links/__init__.py | 30 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/interfaces/links/test_cases.py (renamed from src/python/src/grpc/framework/interfaces/links/test_cases.py) | 4 | ||||
-rw-r--r-- | src/python/grpcio_test/grpc_test/framework/interfaces/links/test_utilities.py (renamed from src/python/src/grpc/framework/interfaces/links/test_utilities.py) | 0 | ||||
-rw-r--r-- | src/python/grpcio_test/requirements.txt | 5 | ||||
-rw-r--r-- | src/python/grpcio_test/setup.cfg | 3 | ||||
-rw-r--r-- | src/python/grpcio_test/setup.py | 79 |
222 files changed, 1003 insertions, 233 deletions
diff --git a/src/compiler/generator_helpers.h b/src/compiler/generator_helpers.h index 7bdaff1c9b..68b807b057 100644 --- a/src/compiler/generator_helpers.h +++ b/src/compiler/generator_helpers.h @@ -126,7 +126,13 @@ inline grpc::string LowerUnderscoreToUpperCamel(grpc::string str) { } inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *file) { - return LowerUnderscoreToUpperCamel(StripProto(file->name())); + std::vector<grpc::string> tokens = tokenize(StripProto(file->name()), "/"); + grpc::string result = ""; + for (unsigned int i = 0; i < tokens.size() - 1; i++) { + result += tokens[i] + "/"; + } + result += LowerUnderscoreToUpperCamel(tokens.back()); + return result; } enum MethodType { diff --git a/src/core/channel/http_client_filter.c b/src/core/channel/http_client_filter.c index 91125cb149..48c623d359 100644 --- a/src/core/channel/http_client_filter.c +++ b/src/core/channel/http_client_filter.c @@ -40,10 +40,12 @@ typedef struct call_data { grpc_linked_mdelem method; grpc_linked_mdelem scheme; + grpc_linked_mdelem authority; grpc_linked_mdelem te_trailers; grpc_linked_mdelem content_type; grpc_linked_mdelem user_agent; int sent_initial_metadata; + int sent_authority; int got_initial_metadata; grpc_stream_op_buffer *recv_ops; @@ -62,6 +64,7 @@ typedef struct channel_data { grpc_mdelem *scheme; grpc_mdelem *content_type; grpc_mdelem *status; + grpc_mdelem *default_authority; /** complete user agent mdelem */ grpc_mdelem *user_agent; } channel_data; @@ -100,6 +103,7 @@ static void hc_on_recv(void *user_data, int success) { static grpc_mdelem *client_strip_filter(void *user_data, grpc_mdelem *md) { grpc_call_element *elem = user_data; + call_data *calld = elem->call_data; channel_data *channeld = elem->channel_data; /* eat the things we'd like to set ourselves */ if (md->key == channeld->method->key) return NULL; @@ -107,6 +111,10 @@ static grpc_mdelem *client_strip_filter(void *user_data, grpc_mdelem *md) { if (md->key == channeld->te_trailers->key) return NULL; if (md->key == channeld->content_type->key) return NULL; if (md->key == channeld->user_agent->key) return NULL; + if (channeld->default_authority && + channeld->default_authority->key == md->key) { + calld->sent_authority = 1; + } return md; } @@ -130,6 +138,11 @@ static void hc_mutate_op(grpc_call_element *elem, GRPC_MDELEM_REF(channeld->method)); grpc_metadata_batch_add_head(&op->data.metadata, &calld->scheme, GRPC_MDELEM_REF(channeld->scheme)); + if (channeld->default_authority && !calld->sent_authority) { + grpc_metadata_batch_add_head( + &op->data.metadata, &calld->authority, + GRPC_MDELEM_REF(channeld->default_authority)); + } grpc_metadata_batch_add_tail(&op->data.metadata, &calld->te_trailers, GRPC_MDELEM_REF(channeld->te_trailers)); grpc_metadata_batch_add_tail(&op->data.metadata, &calld->content_type, @@ -162,6 +175,7 @@ static void init_call_elem(grpc_call_element *elem, call_data *calld = elem->call_data; calld->sent_initial_metadata = 0; calld->got_initial_metadata = 0; + calld->sent_authority = 0; calld->on_done_recv = NULL; grpc_iomgr_closure_init(&calld->hc_on_recv, hc_on_recv, elem); if (initial_op) hc_mutate_op(elem, initial_op); @@ -241,8 +255,10 @@ static grpc_mdstr *user_agent_from_args(grpc_mdctx *mdctx, /* Constructor for channel_data */ static void init_channel_elem(grpc_channel_element *elem, grpc_channel *master, - const grpc_channel_args *args, grpc_mdctx *mdctx, - int is_first, int is_last) { + const grpc_channel_args *channel_args, + grpc_mdctx *mdctx, int is_first, int is_last) { + size_t i; + /* grab pointers to our data from the channel element */ channel_data *channeld = elem->channel_data; @@ -251,17 +267,32 @@ static void init_channel_elem(grpc_channel_element *elem, grpc_channel *master, path */ GPR_ASSERT(!is_last); + channeld->default_authority = NULL; + if (channel_args) { + for (i = 0; i < channel_args->num_args; i++) { + if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_DEFAULT_AUTHORITY)) { + if (channel_args->args[i].type != GRPC_ARG_STRING) { + gpr_log(GPR_ERROR, "%s: must be an string", + GRPC_ARG_DEFAULT_AUTHORITY); + } else { + channeld->default_authority = grpc_mdelem_from_strings( + mdctx, ":authority", channel_args->args[i].value.string); + } + } + } + } + /* initialize members */ channeld->te_trailers = grpc_mdelem_from_strings(mdctx, "te", "trailers"); channeld->method = grpc_mdelem_from_strings(mdctx, ":method", "POST"); - channeld->scheme = - grpc_mdelem_from_strings(mdctx, ":scheme", scheme_from_args(args)); + channeld->scheme = grpc_mdelem_from_strings(mdctx, ":scheme", + scheme_from_args(channel_args)); channeld->content_type = grpc_mdelem_from_strings(mdctx, "content-type", "application/grpc"); channeld->status = grpc_mdelem_from_strings(mdctx, ":status", "200"); channeld->user_agent = grpc_mdelem_from_metadata_strings( mdctx, grpc_mdstr_from_string(mdctx, "user-agent", 0), - user_agent_from_args(mdctx, args)); + user_agent_from_args(mdctx, channel_args)); } /* Destructor for channel data */ @@ -275,6 +306,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) { GRPC_MDELEM_UNREF(channeld->content_type); GRPC_MDELEM_UNREF(channeld->status); GRPC_MDELEM_UNREF(channeld->user_agent); + if (channeld->default_authority) { + GRPC_MDELEM_UNREF(channeld->default_authority); + } } const grpc_channel_filter grpc_http_client_filter = { diff --git a/src/core/channel/http_server_filter.c b/src/core/channel/http_server_filter.c index 9d89eb9bf2..0955ae319a 100644 --- a/src/core/channel/http_server_filter.c +++ b/src/core/channel/http_server_filter.c @@ -44,6 +44,7 @@ typedef struct call_data { gpr_uint8 sent_status; gpr_uint8 seen_scheme; gpr_uint8 seen_te_trailers; + gpr_uint8 seen_authority; grpc_linked_mdelem status; grpc_stream_op_buffer *recv_ops; @@ -125,6 +126,9 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) { } calld->seen_path = 1; return md; + } else if (md->key == channeld->authority_key) { + calld->seen_authority = 1; + return md; } else if (md->key == channeld->host_key) { /* translate host to :authority since :authority may be omitted */ @@ -132,6 +136,7 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) { channeld->mdctx, GRPC_MDSTR_REF(channeld->authority_key), GRPC_MDSTR_REF(md->value)); GRPC_MDELEM_UNREF(md); + calld->seen_authority = 1; return authority; } else { return md; @@ -154,12 +159,15 @@ static void hs_on_recv(void *user_data, int success) { (:method, :scheme, content-type, with :path and :authority covered at the channel level right now) */ if (calld->seen_post && calld->seen_scheme && calld->seen_te_trailers && - calld->seen_path) { + calld->seen_path && calld->seen_authority) { /* do nothing */ } else { if (!calld->seen_path) { gpr_log(GPR_ERROR, "Missing :path header"); } + if (!calld->seen_authority) { + gpr_log(GPR_ERROR, "Missing :authority header"); + } if (!calld->seen_post) { gpr_log(GPR_ERROR, "Missing :method header"); } diff --git a/src/core/client_config/resolvers/dns_resolver.c b/src/core/client_config/resolvers/dns_resolver.c index ac401bc4d3..827b1a2be5 100644 --- a/src/core/client_config/resolvers/dns_resolver.c +++ b/src/core/client_config/resolvers/dns_resolver.c @@ -36,9 +36,11 @@ #include <string.h> #include <grpc/support/alloc.h> +#include <grpc/support/host_port.h> #include <grpc/support/string_util.h> #include "src/core/client_config/lb_policies/pick_first.h" +#include "src/core/client_config/subchannel_factory_decorators/add_channel_arg.h" #include "src/core/iomgr/resolve_address.h" #include "src/core/support/string.h" @@ -201,6 +203,9 @@ static grpc_resolver *dns_create( grpc_subchannel_factory *subchannel_factory) { dns_resolver *r; const char *path = uri->path; + grpc_arg default_host_arg; + char *host; + char *port; if (0 != strcmp(uri->authority, "")) { gpr_log(GPR_ERROR, "authority based uri's not supported"); @@ -209,6 +214,16 @@ static grpc_resolver *dns_create( if (path[0] == '/') ++path; + gpr_split_host_port(path, &host, &port); + + default_host_arg.type = GRPC_ARG_STRING; + default_host_arg.key = GRPC_ARG_DEFAULT_AUTHORITY; + default_host_arg.value.string = host; + subchannel_factory = grpc_subchannel_factory_add_channel_arg(subchannel_factory, &default_host_arg); + + gpr_free(host); + gpr_free(port); + r = gpr_malloc(sizeof(dns_resolver)); memset(r, 0, sizeof(*r)); gpr_ref_init(&r->refs, 1); @@ -218,7 +233,6 @@ static grpc_resolver *dns_create( r->default_port = gpr_strdup(default_port); r->subchannel_factory = subchannel_factory; r->lb_policy_factory = lb_policy_factory; - grpc_subchannel_factory_ref(subchannel_factory); return &r->base; } diff --git a/src/core/client_config/subchannel_factory_decorators/add_channel_arg.c b/src/core/client_config/subchannel_factory_decorators/add_channel_arg.c new file mode 100644 index 0000000000..7dc6d99ebe --- /dev/null +++ b/src/core/client_config/subchannel_factory_decorators/add_channel_arg.c @@ -0,0 +1,43 @@ +/* + * + * 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. + * + */ + +#include "src/core/client_config/subchannel_factory_decorators/add_channel_arg.h" +#include "src/core/client_config/subchannel_factory_decorators/merge_channel_args.h" + +grpc_subchannel_factory *grpc_subchannel_factory_add_channel_arg( + grpc_subchannel_factory *input, const grpc_arg *arg) { + grpc_channel_args args; + args.num_args = 1; + args.args = (grpc_arg *)arg; + return grpc_subchannel_factory_merge_channel_args(input, &args); +} diff --git a/src/core/client_config/subchannel_factory_decorators/add_channel_arg.h b/src/core/client_config/subchannel_factory_decorators/add_channel_arg.h new file mode 100644 index 0000000000..1937623374 --- /dev/null +++ b/src/core/client_config/subchannel_factory_decorators/add_channel_arg.h @@ -0,0 +1,45 @@ +/* + * + * 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. + * + */ + +#ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_ADD_CHANNEL_ARG_H +#define GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_ADD_CHANNEL_ARG_H + +#include "src/core/client_config/subchannel_factory.h" + +/** Takes a subchannel factory, returns a new one that mutates incoming + channel_args by adding a new argument; ownership of input, arg is retained + by the caller. */ +grpc_subchannel_factory *grpc_subchannel_factory_add_channel_arg( + grpc_subchannel_factory *input, const grpc_arg *arg); + +#endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_ADD_CHANNEL_ARG_H */ diff --git a/src/core/client_config/subchannel_factory_decorators/merge_channel_args.c b/src/core/client_config/subchannel_factory_decorators/merge_channel_args.c new file mode 100644 index 0000000000..7e028857ac --- /dev/null +++ b/src/core/client_config/subchannel_factory_decorators/merge_channel_args.c @@ -0,0 +1,84 @@ +/* + * + * 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. + * + */ + +#include "src/core/client_config/subchannel_factory_decorators/merge_channel_args.h" +#include <grpc/support/alloc.h> +#include "src/core/channel/channel_args.h" + +typedef struct { + grpc_subchannel_factory base; + gpr_refcount refs; + grpc_subchannel_factory *wrapped; + grpc_channel_args *merge_args; +} merge_args_factory; + +static void merge_args_factory_ref(grpc_subchannel_factory *scf) { + merge_args_factory *f = (merge_args_factory *)scf; + gpr_ref(&f->refs); +} + +static void merge_args_factory_unref(grpc_subchannel_factory *scf) { + merge_args_factory *f = (merge_args_factory *)scf; + if (gpr_unref(&f->refs)) { + grpc_subchannel_factory_unref(f->wrapped); + grpc_channel_args_destroy(f->merge_args); + gpr_free(f); + } +} + +static grpc_subchannel *merge_args_factory_create_subchannel( + grpc_subchannel_factory *scf, grpc_subchannel_args *args) { + merge_args_factory *f = (merge_args_factory *)scf; + grpc_channel_args *final_args = + grpc_channel_args_merge(args->args, f->merge_args); + grpc_subchannel *s; + args->args = final_args; + s = grpc_subchannel_factory_create_subchannel(f->wrapped, args); + grpc_channel_args_destroy(final_args); + return s; +} + +static const grpc_subchannel_factory_vtable merge_args_factory_vtable = { + merge_args_factory_ref, merge_args_factory_unref, + merge_args_factory_create_subchannel}; + +grpc_subchannel_factory *grpc_subchannel_factory_merge_channel_args( + grpc_subchannel_factory *input, const grpc_channel_args *args) { + merge_args_factory *f = gpr_malloc(sizeof(*f)); + f->base.vtable = &merge_args_factory_vtable; + gpr_ref_init(&f->refs, 1); + grpc_subchannel_factory_ref(input); + f->wrapped = input; + f->merge_args = grpc_channel_args_copy(args); + return &f->base; +} diff --git a/src/core/client_config/subchannel_factory_decorators/merge_channel_args.h b/src/core/client_config/subchannel_factory_decorators/merge_channel_args.h new file mode 100644 index 0000000000..73a03b752f --- /dev/null +++ b/src/core/client_config/subchannel_factory_decorators/merge_channel_args.h @@ -0,0 +1,45 @@ +/* + * + * 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. + * + */ + +#ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_MERGE_CHANNEL_ARGS_H +#define GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_MERGE_CHANNEL_ARGS_H + +#include "src/core/client_config/subchannel_factory.h" + +/** Takes a subchannel factory, returns a new one that mutates incoming + channel_args by adding a new argument; ownership of input, args is retained + by the caller. */ +grpc_subchannel_factory *grpc_subchannel_factory_merge_channel_args( + grpc_subchannel_factory *input, const grpc_channel_args *args); + +#endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_DECORATORS_MERGE_CHANNEL_ARGS_H */ diff --git a/src/core/iomgr/fd_posix.c b/src/core/iomgr/fd_posix.c index 6ad377ce1c..a2df838d4a 100644 --- a/src/core/iomgr/fd_posix.c +++ b/src/core/iomgr/fd_posix.c @@ -102,6 +102,7 @@ static grpc_fd *alloc_fd(int fd) { r->freelist_next = NULL; r->read_watcher = r->write_watcher = NULL; r->on_done_closure = NULL; + r->closed = 0; return r; } @@ -209,6 +210,8 @@ void grpc_fd_orphan(grpc_fd *fd, grpc_iomgr_closure *on_done, REF_BY(fd, 1, reason); /* remove active status, but keep referenced */ gpr_mu_lock(&fd->watcher_mu); if (!has_watchers(fd)) { + GPR_ASSERT(!fd->closed); + fd->closed = 1; close(fd->fd); if (fd->on_done_closure) { grpc_iomgr_add_callback(fd->on_done_closure); @@ -426,7 +429,8 @@ void grpc_fd_end_poll(grpc_fd_watcher *watcher, int got_read, int got_write) { if (kick) { maybe_wake_one_watcher_locked(fd); } - if (grpc_fd_is_orphaned(fd) && !has_watchers(fd)) { + if (grpc_fd_is_orphaned(fd) && !has_watchers(fd) && !fd->closed) { + fd->closed = 1; close(fd->fd); if (fd->on_done_closure != NULL) { grpc_iomgr_add_callback(fd->on_done_closure); diff --git a/src/core/iomgr/fd_posix.h b/src/core/iomgr/fd_posix.h index 94d0019fa4..4e8e267ffd 100644 --- a/src/core/iomgr/fd_posix.h +++ b/src/core/iomgr/fd_posix.h @@ -60,6 +60,7 @@ struct grpc_fd { gpr_mu set_state_mu; gpr_atm shutdown; + int closed; /* The watcher list. diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c index 8538600112..6399aaadb9 100644 --- a/src/core/iomgr/tcp_server_posix.c +++ b/src/core/iomgr/tcp_server_posix.c @@ -142,6 +142,7 @@ grpc_tcp_server *grpc_tcp_server_create(void) { static void finish_shutdown(grpc_tcp_server *s) { s->shutdown_complete(s->shutdown_complete_arg); + s->shutdown_complete = NULL; gpr_mu_destroy(&s->mu); @@ -157,6 +158,7 @@ static void destroyed_port(void *server, int success) { gpr_mu_unlock(&s->mu); finish_shutdown(s); } else { + GPR_ASSERT(s->destroyed_ports < s->nports); gpr_mu_unlock(&s->mu); } } diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c index 5e0457a37b..89aa741470 100644 --- a/src/core/iomgr/tcp_windows.c +++ b/src/core/iomgr/tcp_windows.c @@ -369,14 +369,16 @@ static grpc_endpoint_write_status win_write(grpc_endpoint *ep, } static void win_add_to_pollset(grpc_endpoint *ep, grpc_pollset *ps) { + grpc_tcp *tcp; (void) ps; - grpc_tcp *tcp = (grpc_tcp *) ep; + tcp = (grpc_tcp *) ep; grpc_iocp_add_socket(tcp->socket); } static void win_add_to_pollset_set(grpc_endpoint *ep, grpc_pollset_set *pss) { + grpc_tcp *tcp; (void) pss; - grpc_tcp *tcp = (grpc_tcp *) ep; + tcp = (grpc_tcp *) ep; grpc_iocp_add_socket(tcp->socket); } diff --git a/src/core/support/stack_lockfree.c b/src/core/support/stack_lockfree.c index f24e272207..bc741f8c70 100644 --- a/src/core/support/stack_lockfree.c +++ b/src/core/support/stack_lockfree.c @@ -95,6 +95,8 @@ gpr_stack_lockfree *gpr_stack_lockfree_create(int entries) { memset(&stack->pushed, 0, sizeof(stack->pushed)); #endif + GPR_ASSERT(sizeof(stack->entries->atm) == sizeof(stack->entries->contents)); + /* Point the head at reserved dummy entry */ stack->head.contents.index = INVALID_ENTRY_INDEX; return stack; @@ -108,11 +110,15 @@ void gpr_stack_lockfree_destroy(gpr_stack_lockfree *stack) { int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) { lockfree_node head; lockfree_node newhead; + lockfree_node curent; + lockfree_node newent; /* First fill in the entry's index and aba ctr for new head */ newhead.contents.index = (gpr_uint16)entry; /* Also post-increment the aba_ctr */ - newhead.contents.aba_ctr = stack->entries[entry].contents.aba_ctr++; + curent.atm = gpr_atm_no_barrier_load(&stack->entries[entry].atm); + newhead.contents.aba_ctr = ++curent.contents.aba_ctr; + gpr_atm_no_barrier_store(&stack->entries[entry].atm, curent.atm); #ifndef NDEBUG /* Check for double push */ @@ -131,7 +137,9 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) { /* Atomically get the existing head value for use */ head.atm = gpr_atm_no_barrier_load(&(stack->head.atm)); /* Point to it */ - stack->entries[entry].contents.index = head.contents.index; + newent.atm = gpr_atm_no_barrier_load(&stack->entries[entry].atm); + newent.contents.index = head.contents.index; + gpr_atm_no_barrier_store(&stack->entries[entry].atm, newent.atm); } while (!gpr_atm_rel_cas(&(stack->head.atm), head.atm, newhead.atm)); /* Use rel_cas above to make sure that entry index is set properly */ return head.contents.index == INVALID_ENTRY_INDEX; diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c index 583d350128..81f673f856 100644 --- a/src/core/surface/channel.c +++ b/src/core/surface/channel.c @@ -149,14 +149,17 @@ static grpc_call *grpc_channel_create_call_internal( grpc_channel *channel, grpc_completion_queue *cq, grpc_mdelem *path_mdelem, grpc_mdelem *authority_mdelem, gpr_timespec deadline) { grpc_mdelem *send_metadata[2]; + int num_metadata = 0; GPR_ASSERT(channel->is_client); - send_metadata[0] = path_mdelem; - send_metadata[1] = authority_mdelem; + send_metadata[num_metadata++] = path_mdelem; + if (authority_mdelem != NULL) { + send_metadata[num_metadata++] = authority_mdelem; + } return grpc_call_create(channel, cq, NULL, send_metadata, - GPR_ARRAY_SIZE(send_metadata), deadline); + num_metadata, deadline); } grpc_call *grpc_channel_create_call(grpc_channel *channel, @@ -168,9 +171,10 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel, grpc_mdelem_from_metadata_strings( channel->metadata_context, GRPC_MDSTR_REF(channel->path_string), grpc_mdstr_from_string(channel->metadata_context, method, 0)), + host ? grpc_mdelem_from_metadata_strings( channel->metadata_context, GRPC_MDSTR_REF(channel->authority_string), - grpc_mdstr_from_string(channel->metadata_context, host, 0)), + grpc_mdstr_from_string(channel->metadata_context, host, 0)) : NULL, deadline); } @@ -180,9 +184,9 @@ void *grpc_channel_register_call(grpc_channel *channel, const char *method, rc->path = grpc_mdelem_from_metadata_strings( channel->metadata_context, GRPC_MDSTR_REF(channel->path_string), grpc_mdstr_from_string(channel->metadata_context, method, 0)); - rc->authority = grpc_mdelem_from_metadata_strings( + rc->authority = host ? grpc_mdelem_from_metadata_strings( channel->metadata_context, GRPC_MDSTR_REF(channel->authority_string), - grpc_mdstr_from_string(channel->metadata_context, host, 0)); + grpc_mdstr_from_string(channel->metadata_context, host, 0)) : NULL; gpr_mu_lock(&channel->registered_call_mu); rc->next = channel->registered_calls; channel->registered_calls = rc; @@ -196,7 +200,7 @@ grpc_call *grpc_channel_create_registered_call( registered_call *rc = registered_call_handle; return grpc_channel_create_call_internal( channel, completion_queue, GRPC_MDELEM_REF(rc->path), - GRPC_MDELEM_REF(rc->authority), deadline); + rc->authority ? GRPC_MDELEM_REF(rc->authority) : NULL, deadline); } #ifdef GRPC_CHANNEL_REF_COUNT_DEBUG diff --git a/src/core/surface/channel_connectivity.c b/src/core/surface/channel_connectivity.c index b6ea86d730..1223706457 100644 --- a/src/core/surface/channel_connectivity.c +++ b/src/core/surface/channel_connectivity.c @@ -70,7 +70,6 @@ typedef struct { grpc_iomgr_closure on_complete; grpc_alarm alarm; grpc_connectivity_state state; - grpc_connectivity_state *optional_new_state; grpc_completion_queue *cq; grpc_cq_completion completion_storage; grpc_channel *channel; @@ -124,9 +123,6 @@ static void partly_done(state_watcher *w, int due_to_completion) { switch (w->phase) { case WAITING: w->phase = CALLING_BACK; - if (w->optional_new_state) { - *w->optional_new_state = w->state; - } grpc_cq_end_op(w->cq, w->tag, w->success, finished_completion, w, &w->completion_storage); break; @@ -154,8 +150,7 @@ static void timeout_complete(void *pw, int success) { partly_done(pw, 0); } void grpc_channel_watch_connectivity_state( grpc_channel *channel, grpc_connectivity_state last_observed_state, - grpc_connectivity_state *optional_new_state, gpr_timespec deadline, - grpc_completion_queue *cq, void *tag) { + gpr_timespec deadline, grpc_completion_queue *cq, void *tag) { grpc_channel_element *client_channel_elem = grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel)); state_watcher *w = gpr_malloc(sizeof(*w)); @@ -167,7 +162,6 @@ void grpc_channel_watch_connectivity_state( w->phase = WAITING; w->state = last_observed_state; w->success = 0; - w->optional_new_state = optional_new_state; w->cq = cq; w->tag = tag; w->channel = channel; diff --git a/src/core/surface/server.c b/src/core/surface/server.c index f19bcbd090..c370a9b8ab 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -554,8 +554,10 @@ static void server_on_recv(void *ptr, int success) { gpr_time_cmp(op_deadline, gpr_inf_future(op_deadline.clock_type))) { calld->deadline = op->data.metadata.deadline; } - calld->got_initial_metadata = 1; - start_new_rpc(elem); + if (calld->host && calld->path) { + calld->got_initial_metadata = 1; + start_new_rpc(elem); + } break; } } @@ -1271,6 +1273,8 @@ static void done_request_event(void *req, grpc_cq_completion *c) { } else { gpr_free(req); } + + server_unref(server); } static void fail_call(grpc_server *server, requested_call *rc) { @@ -1283,6 +1287,7 @@ static void fail_call(grpc_server *server, requested_call *rc) { rc->data.registered.initial_metadata->count = 0; break; } + server_ref(server); grpc_cq_end_op(rc->cq_for_notification, rc->tag, 0, done_request_event, rc, &rc->completion); } @@ -1293,6 +1298,8 @@ static void publish_registered_or_batch(grpc_call *call, int success, grpc_call_stack_element(grpc_call_get_call_stack(call), 0); requested_call *rc = prc; call_data *calld = elem->call_data; + channel_data *chand = elem->channel_data; + server_ref(chand->server); grpc_cq_end_op(calld->cq_new, rc->tag, success, done_request_event, rc, &rc->completion); GRPC_CALL_INTERNAL_UNREF(call, "server", 0); diff --git a/src/core/transport/chttp2/alpn.c b/src/core/transport/chttp2/alpn.c index 3ccd5796ba..69da4e6718 100644 --- a/src/core/transport/chttp2/alpn.c +++ b/src/core/transport/chttp2/alpn.c @@ -36,8 +36,7 @@ #include <grpc/support/useful.h> /* in order of preference */ -static const char *const supported_versions[] = {"h2", "h2-17", "h2-16", - "h2-15", "h2-14"}; +static const char *const supported_versions[] = {"h2"}; int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size) { size_t i; diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 14ab772e50..c38d0c1df6 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -34,6 +34,7 @@ #include <grpc++/client_context.h> #include <grpc/grpc.h> +#include <grpc/support/alloc.h> #include <grpc/support/string_util.h> #include <grpc++/credentials.h> #include <grpc++/time.h> @@ -104,4 +105,14 @@ void ClientContext::TryCancel() { } } +grpc::string ClientContext::peer() const { + grpc::string peer; + if (call_) { + char* c_peer = grpc_call_get_peer(call_); + peer = c_peer; + gpr_free(c_peer); + } + return peer; +} + } // namespace grpc diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index f6c073040b..cf19556e7a 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -34,6 +34,7 @@ #include <grpc++/server_context.h> #include <grpc/grpc.h> +#include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc++/impl/call.h> #include <grpc++/impl/sync.h> @@ -179,6 +180,16 @@ std::shared_ptr<const AuthContext> ServerContext::auth_context() const { return auth_context_; } +grpc::string ServerContext::peer() const { + grpc::string peer; + if (call_) { + char* c_peer = grpc_call_get_peer(call_); + peer = c_peer; + gpr_free(c_peer); + } + return peer; +} + const struct census_context* ServerContext::census_context() const { return grpc_census_call_get_context(call_); } diff --git a/src/node/examples/math_server.js b/src/node/examples/math_server.js index b1f8a6323f..31892c65df 100644 --- a/src/node/examples/math_server.js +++ b/src/node/examples/math_server.js @@ -115,7 +115,7 @@ server.addProtoService(math.Math.service, { }); if (require.main === module) { - server.bind('0.0.0.0:50051'); + server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure()); server.start(); } diff --git a/src/node/examples/route_guide_server.js b/src/node/examples/route_guide_server.js index 70044a322c..bb8e79b5bd 100644 --- a/src/node/examples/route_guide_server.js +++ b/src/node/examples/route_guide_server.js @@ -239,7 +239,7 @@ function getServer() { if (require.main === module) { // If this is run as a script, start a server on an unused port var routeServer = getServer(); - routeServer.bind('0.0.0.0:50051'); + routeServer.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure()); var argv = parseArgs(process.argv, { string: 'db_path' }); diff --git a/src/node/examples/stock_server.js b/src/node/examples/stock_server.js index f2eb6ad4ab..dfcfe30eb4 100644 --- a/src/node/examples/stock_server.js +++ b/src/node/examples/stock_server.js @@ -80,7 +80,7 @@ stockServer.addProtoService(examples.Stock.service, { }); if (require.main === module) { - stockServer.bind('0.0.0.0:50051'); + stockServer.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure()); stockServer.listen(); } diff --git a/src/node/ext/server.cc b/src/node/ext/server.cc index 8554fce777..04fabc871d 100644 --- a/src/node/ext/server.cc +++ b/src/node/ext/server.cc @@ -136,10 +136,6 @@ void Server::Init(Handle<Object> exports) { tpl, "addHttp2Port", NanNew<FunctionTemplate>(AddHttp2Port)->GetFunction()); - NanSetPrototypeTemplate( - tpl, "addSecureHttp2Port", - NanNew<FunctionTemplate>(AddSecureHttp2Port)->GetFunction()); - NanSetPrototypeTemplate(tpl, "start", NanNew<FunctionTemplate>(Start)->GetFunction()); @@ -248,43 +244,35 @@ NAN_METHOD(Server::RequestCall) { NAN_METHOD(Server::AddHttp2Port) { NanScope(); if (!HasInstance(args.This())) { - return NanThrowTypeError("addHttp2Port can only be called on a Server"); - } - if (!args[0]->IsString()) { - return NanThrowTypeError("addHttp2Port's argument must be a String"); - } - Server *server = ObjectWrap::Unwrap<Server>(args.This()); - if (server->wrapped_server == NULL) { - return NanThrowError("addHttp2Port cannot be called on a shut down Server"); - } - NanReturnValue(NanNew<Number>(grpc_server_add_http2_port( - server->wrapped_server, *NanUtf8String(args[0])))); -} - -NAN_METHOD(Server::AddSecureHttp2Port) { - NanScope(); - if (!HasInstance(args.This())) { return NanThrowTypeError( - "addSecureHttp2Port can only be called on a Server"); + "addHttp2Port can only be called on a Server"); } if (!args[0]->IsString()) { return NanThrowTypeError( - "addSecureHttp2Port's first argument must be a String"); + "addHttp2Port's first argument must be a String"); } if (!ServerCredentials::HasInstance(args[1])) { return NanThrowTypeError( - "addSecureHttp2Port's second argument must be ServerCredentials"); + "addHttp2Port's second argument must be ServerCredentials"); } Server *server = ObjectWrap::Unwrap<Server>(args.This()); if (server->wrapped_server == NULL) { return NanThrowError( - "addSecureHttp2Port cannot be called on a shut down Server"); + "addHttp2Port cannot be called on a shut down Server"); } - ServerCredentials *creds = ObjectWrap::Unwrap<ServerCredentials>( + ServerCredentials *creds_object = ObjectWrap::Unwrap<ServerCredentials>( args[1]->ToObject()); - NanReturnValue(NanNew<Number>(grpc_server_add_secure_http2_port( - server->wrapped_server, *NanUtf8String(args[0]), - creds->GetWrappedServerCredentials()))); + grpc_server_credentials *creds = creds_object->GetWrappedServerCredentials(); + int port; + if (creds == NULL) { + port = grpc_server_add_http2_port(server->wrapped_server, + *NanUtf8String(args[0])); + } else { + port = grpc_server_add_secure_http2_port(server->wrapped_server, + *NanUtf8String(args[0]), + creds); + } + NanReturnValue(NanNew<Number>(port)); } NAN_METHOD(Server::Start) { diff --git a/src/node/ext/server.h b/src/node/ext/server.h index 5b4b18a0e0..faab7e3418 100644 --- a/src/node/ext/server.h +++ b/src/node/ext/server.h @@ -66,7 +66,6 @@ class Server : public ::node::ObjectWrap { static NAN_METHOD(New); static NAN_METHOD(RequestCall); static NAN_METHOD(AddHttp2Port); - static NAN_METHOD(AddSecureHttp2Port); static NAN_METHOD(Start); static NAN_METHOD(Shutdown); static NanCallback *constructor; diff --git a/src/node/ext/server_credentials.cc b/src/node/ext/server_credentials.cc index c4a93a6465..1b8e7b43fb 100644 --- a/src/node/ext/server_credentials.cc +++ b/src/node/ext/server_credentials.cc @@ -73,6 +73,8 @@ void ServerCredentials::Init(Handle<Object> exports) { Handle<Function> ctr = tpl->GetFunction(); ctr->Set(NanNew("createSsl"), NanNew<FunctionTemplate>(CreateSsl)->GetFunction()); + ctr->Set(NanNew("createInsecure"), + NanNew<FunctionTemplate>(CreateInsecure)->GetFunction()); constructor = new NanCallback(ctr); exports->Set(NanNew("ServerCredentials"), ctr); } @@ -85,9 +87,6 @@ bool ServerCredentials::HasInstance(Handle<Value> val) { Handle<Value> ServerCredentials::WrapStruct( grpc_server_credentials *credentials) { NanEscapableScope(); - if (credentials == NULL) { - return NanEscapeScope(NanNull()); - } const int argc = 1; Handle<Value> argv[argc] = { NanNew<External>(reinterpret_cast<void *>(credentials))}; @@ -140,8 +139,17 @@ NAN_METHOD(ServerCredentials::CreateSsl) { key_cert_pair.cert_chain = ::node::Buffer::Data(args[2]); // TODO Add a force_client_auth parameter and pass it as the last parameter // here. - NanReturnValue(WrapStruct( - grpc_ssl_server_credentials_create(root_certs, &key_cert_pair, 1, 0))); + grpc_server_credentials *creds = + grpc_ssl_server_credentials_create(root_certs, &key_cert_pair, 1, 0); + if (creds == NULL) { + NanReturnNull(); + } + NanReturnValue(WrapStruct(creds)); +} + +NAN_METHOD(ServerCredentials::CreateInsecure) { + NanScope(); + NanReturnValue(WrapStruct(NULL)); } } // namespace node diff --git a/src/node/ext/server_credentials.h b/src/node/ext/server_credentials.h index 80747504a1..63903f663c 100644 --- a/src/node/ext/server_credentials.h +++ b/src/node/ext/server_credentials.h @@ -63,6 +63,7 @@ class ServerCredentials : public ::node::ObjectWrap { static NAN_METHOD(New); static NAN_METHOD(CreateSsl); + static NAN_METHOD(CreateInsecure); static NanCallback *constructor; // Used for typechecking instances of this javascript class static v8::Persistent<v8::FunctionTemplate> fun_tpl; diff --git a/src/node/interop/interop_server.js b/src/node/interop/interop_server.js index 505c6bb537..ece22cce31 100644 --- a/src/node/interop/interop_server.js +++ b/src/node/interop/interop_server.js @@ -161,7 +161,7 @@ function handleHalfDuplex(call) { function getServer(port, tls) { // TODO(mlumish): enable TLS functionality var options = {}; - var server_creds = null; + var server_creds; if (tls) { var key_path = path.join(__dirname, '../test/data/server1.key'); var pem_path = path.join(__dirname, '../test/data/server1.pem'); @@ -171,6 +171,8 @@ function getServer(port, tls) { server_creds = grpc.ServerCredentials.createSsl(null, key_data, pem_data); + } else { + server_creds = grpc.ServerCredentials.createInsecure(); } var server = new grpc.Server(options); server.addProtoService(testProto.TestService.service, { diff --git a/src/node/src/server.js b/src/node/src/server.js index 9fbd1ee3bd..5c62f5990c 100644 --- a/src/node/src/server.js +++ b/src/node/src/server.js @@ -714,11 +714,7 @@ Server.prototype.bind = function(port, creds) { if (this.started) { throw new Error('Can\'t bind an already running server to an address'); } - if (creds) { - return this._server.addSecureHttp2Port(port, creds); - } else { - return this._server.addHttp2Port(port); - } + return this._server.addHttp2Port(port, creds); }; /** diff --git a/src/node/test/call_test.js b/src/node/test/call_test.js index c5edab8bcd..48d859a8ec 100644 --- a/src/node/test/call_test.js +++ b/src/node/test/call_test.js @@ -55,7 +55,8 @@ describe('call', function() { var server; before(function() { server = new grpc.Server(); - var port = server.addHttp2Port('localhost:0'); + var port = server.addHttp2Port('localhost:0', + grpc.ServerCredentials.createInsecure()); server.start(); channel = new grpc.Channel('localhost:' + port, insecureCreds); }); diff --git a/src/node/test/end_to_end_test.js b/src/node/test/end_to_end_test.js index 9133ceca92..ea41dfc28c 100644 --- a/src/node/test/end_to_end_test.js +++ b/src/node/test/end_to_end_test.js @@ -64,7 +64,8 @@ describe('end-to-end', function() { var channel; before(function() { server = new grpc.Server(); - var port_num = server.addHttp2Port('0.0.0.0:0'); + var port_num = server.addHttp2Port('0.0.0.0:0', + grpc.ServerCredentials.createInsecure()); server.start(); channel = new grpc.Channel('localhost:' + port_num, insecureCreds); }); diff --git a/src/node/test/health_test.js b/src/node/test/health_test.js index 93b068be31..be4ef1d251 100644 --- a/src/node/test/health_test.js +++ b/src/node/test/health_test.js @@ -54,7 +54,8 @@ describe('Health Checking', function() { new health.Implementation(statusMap)); var healthClient; before(function() { - var port_num = healthServer.bind('0.0.0.0:0'); + var port_num = healthServer.bind('0.0.0.0:0', + grpc.ServerCredentials.createInsecure()); healthServer.start(); healthClient = new health.Client('localhost:' + port_num, grpc.Credentials.createInsecure()); diff --git a/src/node/test/math_client_test.js b/src/node/test/math_client_test.js index 1bd85ca495..ef01870a4c 100644 --- a/src/node/test/math_client_test.js +++ b/src/node/test/math_client_test.js @@ -51,7 +51,8 @@ var server = require('../examples/math_server.js'); describe('Math client', function() { before(function(done) { - var port_num = server.bind('0.0.0.0:0'); + var port_num = server.bind('0.0.0.0:0', + grpc.ServerCredentials.createInsecure()); server.start(); math_client = new math.Math('localhost:' + port_num, grpc.Credentials.createInsecure()); diff --git a/src/node/test/server_test.js b/src/node/test/server_test.js index 9c7bb465aa..a9df43909e 100644 --- a/src/node/test/server_test.js +++ b/src/node/test/server_test.js @@ -59,16 +59,11 @@ describe('server', function() { it('should bind to an unused port', function() { var port; assert.doesNotThrow(function() { - port = server.addHttp2Port('0.0.0.0:0'); + port = server.addHttp2Port('0.0.0.0:0', + grpc.ServerCredentials.createInsecure()); }); assert(port > 0); }); - }); - describe('addSecureHttp2Port', function() { - var server; - before(function() { - server = new grpc.Server(); - }); it('should bind to an unused port with ssl credentials', function() { var port; var key_path = path.join(__dirname, '../test/data/server1.key'); @@ -77,16 +72,22 @@ describe('server', function() { var pem_data = fs.readFileSync(pem_path); var creds = grpc.ServerCredentials.createSsl(null, key_data, pem_data); assert.doesNotThrow(function() { - port = server.addSecureHttp2Port('0.0.0.0:0', creds); + port = server.addHttp2Port('0.0.0.0:0', creds); }); assert(port > 0); }); }); + describe('addSecureHttp2Port', function() { + var server; + before(function() { + server = new grpc.Server(); + }); + }); describe('listen', function() { var server; before(function() { server = new grpc.Server(); - server.addHttp2Port('0.0.0.0:0'); + server.addHttp2Port('0.0.0.0:0', grpc.ServerCredentials.createInsecure()); }); after(function() { server.shutdown(); diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js index 18c99a5994..dda2f8d127 100644 --- a/src/node/test/surface_test.js +++ b/src/node/test/surface_test.js @@ -47,6 +47,8 @@ var mathService = math_proto.lookup('math.Math'); var _ = require('lodash'); +var server_insecure_creds = grpc.ServerCredentials.createInsecure(); + describe('File loader', function() { it('Should load a proto file by default', function() { assert.doesNotThrow(function() { @@ -122,7 +124,7 @@ describe('Echo service', function() { callback(null, call.request); } }); - var port = server.bind('localhost:0'); + var port = server.bind('localhost:0', server_insecure_creds); var Client = surface_client.makeProtobufClientConstructor(echo_service); client = new Client('localhost:' + port, grpc.Credentials.createInsecure()); server.start(); @@ -166,7 +168,7 @@ describe('Generic client and server', function() { callback(null, _.capitalize(call.request)); } }); - var port = server.bind('localhost:0'); + var port = server.bind('localhost:0', server_insecure_creds); server.start(); var Client = grpc.makeGenericClientConstructor(string_service_attrs); client = new Client('localhost:' + port, @@ -215,7 +217,7 @@ describe('Echo metadata', function() { }); } }); - var port = server.bind('localhost:0'); + var port = server.bind('localhost:0', server_insecure_creds); var Client = surface_client.makeProtobufClientConstructor(test_service); client = new Client('localhost:' + port, grpc.Credentials.createInsecure()); server.start(); @@ -336,7 +338,7 @@ describe('Other conditions', function() { }); } }); - port = server.bind('localhost:0'); + port = server.bind('localhost:0', server_insecure_creds); var Client = surface_client.makeProtobufClientConstructor(test_service); client = new Client('localhost:' + port, grpc.Credentials.createInsecure()); server.start(); @@ -602,7 +604,7 @@ describe('Cancelling surface client', function() { 'fib': function(stream) {}, 'sum': function(stream) {} }); - var port = server.bind('localhost:0'); + var port = server.bind('localhost:0', server_insecure_creds); var Client = surface_client.makeProtobufClientConstructor(mathService); client = new Client('localhost:' + port, grpc.Credentials.createInsecure()); server.start(); diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 9435bf2b35..9d9648ae28 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -38,7 +38,6 @@ #import <RxLibrary/GRXConcurrentWriteable.h> #import "private/GRPCChannel.h" -#import "private/GRPCCompletionQueue.h" #import "private/GRPCWrappedCall.h" #import "private/NSData+GRPC.h" #import "private/NSDictionary+GRPC.h" @@ -72,7 +71,6 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey"; dispatch_once_t _callAlreadyInvoked; GRPCChannel *_channel; - GRPCCompletionQueue *_completionQueue; // The C gRPC library has less guarantees on the ordering of events than we // do. Particularly, in the face of errors, there's no ordering guarantee at @@ -100,19 +98,13 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey"; path:(NSString *)path requestsWriter:(GRXWriter *)requestWriter { if (!host || !path) { - [NSException raise:NSInvalidArgumentException format:@"Neither host nor method can be nil."]; + [NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil."]; } if (requestWriter.state != GRXWriterStateNotStarted) { - [NSException raise:NSInvalidArgumentException format:@"The requests writer can't be already started."]; + [NSException raise:NSInvalidArgumentException + format:@"The requests writer can't be already started."]; } if ((self = [super init])) { - static dispatch_once_t initialization; - dispatch_once(&initialization, ^{ - grpc_init(); - }); - - _completionQueue = [GRPCCompletionQueue completionQueue]; - _channel = [GRPCChannel channelToHost:host]; _wrappedCall = [[GRPCWrappedCall alloc] initWithChannel:_channel diff --git a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.h b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.h index 603bf01939..ab8d714d22 100644 --- a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.h +++ b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.h @@ -36,15 +36,15 @@ typedef void(^GRPCQueueCompletionHandler)(bool success); -// This class lets one more easily use grpc_completion_queue. To use it, pass -// the value of the unmanagedQueue property of an instance of this class to -// grpc_call_start_invoke. Then for every grpc_call_* method that accepts a tag, -// you can pass a block of type GRPCEventHandler (remembering to cast it using -// __bridge_retained). The block is guaranteed to eventually be called, by a -// concurrent queue, and then released. Each such block is passed a pointer to -// the grpc_event that carried it (in event->tag). -// Release the GRPCCompletionQueue object only after you are not going to pass -// any more blocks to the grpc_call that's using it. +// This class lets one more easily use |grpc_completion_queue|. To use it, pass the value of the +// |unmanagedQueue| property of an instance of this class to |grpc_channel_create_call|. Then for +// every |grpc_call_*| method that accepts a tag, you can pass a block of type +// |GRPCQueueCompletionHandler| (remembering to cast it using |__bridge_retained|). The block is +// guaranteed to eventually be called, by a concurrent queue, and then released. Each such block is +// passed a |bool| that tells if the operation was successful. +// +// Release the GRPCCompletionQueue object only after you are not going to pass any more blocks to +// the |grpc_call| that's using it. @interface GRPCCompletionQueue : NSObject @property(nonatomic, readonly) grpc_completion_queue *unmanagedQueue; diff --git a/src/python/src/.gitignore b/src/python/grpcio/.gitignore index d89f3db999..efbe1737ba 100644 --- a/src/python/src/.gitignore +++ b/src/python/grpcio/.gitignore @@ -1,5 +1,5 @@ MANIFEST -grpcio.egg-info/ +*.egg-info/ build/ dist/ *.egg diff --git a/src/python/src/MANIFEST.in b/src/python/grpcio/MANIFEST.in index 498b55f20a..9583dc7768 100644 --- a/src/python/src/MANIFEST.in +++ b/src/python/grpcio/MANIFEST.in @@ -1,2 +1,3 @@ graft grpc include commands.py +include requirements.txt diff --git a/src/python/src/README.rst b/src/python/grpcio/README.rst index 00bdecf56f..00bdecf56f 100644 --- a/src/python/src/README.rst +++ b/src/python/grpcio/README.rst diff --git a/src/python/src/commands.py b/src/python/grpcio/commands.py index 8e87855011..605d9d5612 100644 --- a/src/python/src/commands.py +++ b/src/python/grpcio/commands.py @@ -43,6 +43,7 @@ napoleon_numpy_docstring = True html_theme = 'sphinx_rtd_theme' """ + class SphinxDocumentation(setuptools.Command): """Command to generate documentation via sphinx.""" diff --git a/src/python/interop/interop/__init__.py b/src/python/grpcio/grpc/__init__.py index 7086519106..7086519106 100644 --- a/src/python/interop/interop/__init__.py +++ b/src/python/grpcio/grpc/__init__.py diff --git a/src/python/src/grpc/_adapter/.gitignore b/src/python/grpcio/grpc/_adapter/.gitignore index a6f96cd6db..a6f96cd6db 100644 --- a/src/python/src/grpc/_adapter/.gitignore +++ b/src/python/grpcio/grpc/_adapter/.gitignore diff --git a/src/python/src/grpc/__init__.py b/src/python/grpcio/grpc/_adapter/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/__init__.py +++ b/src/python/grpcio/grpc/_adapter/__init__.py diff --git a/src/python/src/grpc/_adapter/_c/module.c b/src/python/grpcio/grpc/_adapter/_c/module.c index 1f3aedd9d8..1f3aedd9d8 100644 --- a/src/python/src/grpc/_adapter/_c/module.c +++ b/src/python/grpcio/grpc/_adapter/_c/module.c diff --git a/src/python/src/grpc/_adapter/_c/types.c b/src/python/grpcio/grpc/_adapter/_c/types.c index 8855c32ca6..8855c32ca6 100644 --- a/src/python/src/grpc/_adapter/_c/types.c +++ b/src/python/grpcio/grpc/_adapter/_c/types.c diff --git a/src/python/src/grpc/_adapter/_c/types.h b/src/python/grpcio/grpc/_adapter/_c/types.h index 4e0da4a28a..4e0da4a28a 100644 --- a/src/python/src/grpc/_adapter/_c/types.h +++ b/src/python/grpcio/grpc/_adapter/_c/types.h diff --git a/src/python/src/grpc/_adapter/_c/types/call.c b/src/python/grpcio/grpc/_adapter/_c/types/call.c index 0739070044..0739070044 100644 --- a/src/python/src/grpc/_adapter/_c/types/call.c +++ b/src/python/grpcio/grpc/_adapter/_c/types/call.c diff --git a/src/python/src/grpc/_adapter/_c/types/channel.c b/src/python/grpcio/grpc/_adapter/_c/types/channel.c index feb256cf00..feb256cf00 100644 --- a/src/python/src/grpc/_adapter/_c/types/channel.c +++ b/src/python/grpcio/grpc/_adapter/_c/types/channel.c diff --git a/src/python/src/grpc/_adapter/_c/types/client_credentials.c b/src/python/grpcio/grpc/_adapter/_c/types/client_credentials.c index e314c15324..e314c15324 100644 --- a/src/python/src/grpc/_adapter/_c/types/client_credentials.c +++ b/src/python/grpcio/grpc/_adapter/_c/types/client_credentials.c diff --git a/src/python/src/grpc/_adapter/_c/types/completion_queue.c b/src/python/grpcio/grpc/_adapter/_c/types/completion_queue.c index 2dd44b6ddd..2dd44b6ddd 100644 --- a/src/python/src/grpc/_adapter/_c/types/completion_queue.c +++ b/src/python/grpcio/grpc/_adapter/_c/types/completion_queue.c diff --git a/src/python/src/grpc/_adapter/_c/types/server.c b/src/python/grpcio/grpc/_adapter/_c/types/server.c index 2a00f34039..2a00f34039 100644 --- a/src/python/src/grpc/_adapter/_c/types/server.c +++ b/src/python/grpcio/grpc/_adapter/_c/types/server.c diff --git a/src/python/src/grpc/_adapter/_c/types/server_credentials.c b/src/python/grpcio/grpc/_adapter/_c/types/server_credentials.c index f6859b79d7..f6859b79d7 100644 --- a/src/python/src/grpc/_adapter/_c/types/server_credentials.c +++ b/src/python/grpcio/grpc/_adapter/_c/types/server_credentials.c diff --git a/src/python/src/grpc/_adapter/_c/utility.c b/src/python/grpcio/grpc/_adapter/_c/utility.c index 51f3c9be01..51f3c9be01 100644 --- a/src/python/src/grpc/_adapter/_c/utility.c +++ b/src/python/grpcio/grpc/_adapter/_c/utility.c diff --git a/src/python/src/grpc/_adapter/_common.py b/src/python/grpcio/grpc/_adapter/_common.py index 492849f4cb..492849f4cb 100644 --- a/src/python/src/grpc/_adapter/_common.py +++ b/src/python/grpcio/grpc/_adapter/_common.py diff --git a/src/python/src/grpc/_adapter/_intermediary_low.py b/src/python/grpcio/grpc/_adapter/_intermediary_low.py index 3c7f0a2619..3c7f0a2619 100644 --- a/src/python/src/grpc/_adapter/_intermediary_low.py +++ b/src/python/grpcio/grpc/_adapter/_intermediary_low.py diff --git a/src/python/src/grpc/_adapter/_low.py b/src/python/grpcio/grpc/_adapter/_low.py index dcf67dbc11..dcf67dbc11 100644 --- a/src/python/src/grpc/_adapter/_low.py +++ b/src/python/grpcio/grpc/_adapter/_low.py diff --git a/src/python/src/grpc/_adapter/_types.py b/src/python/grpcio/grpc/_adapter/_types.py index 5ddb1774ea..5ddb1774ea 100644 --- a/src/python/src/grpc/_adapter/_types.py +++ b/src/python/grpcio/grpc/_adapter/_types.py diff --git a/src/python/src/grpc/_adapter/fore.py b/src/python/grpcio/grpc/_adapter/fore.py index 7d88bda263..7d88bda263 100644 --- a/src/python/src/grpc/_adapter/fore.py +++ b/src/python/grpcio/grpc/_adapter/fore.py diff --git a/src/python/src/grpc/_adapter/rear.py b/src/python/grpcio/grpc/_adapter/rear.py index fd6f45f7a7..fd6f45f7a7 100644 --- a/src/python/src/grpc/_adapter/rear.py +++ b/src/python/grpcio/grpc/_adapter/rear.py diff --git a/src/python/src/grpc/_cython/.gitignore b/src/python/grpcio/grpc/_cython/.gitignore index c315029288..c315029288 100644 --- a/src/python/src/grpc/_cython/.gitignore +++ b/src/python/grpcio/grpc/_cython/.gitignore diff --git a/src/python/src/grpc/_cython/README.rst b/src/python/grpcio/grpc/_cython/README.rst index c0e66734e8..c0e66734e8 100644 --- a/src/python/src/grpc/_cython/README.rst +++ b/src/python/grpcio/grpc/_cython/README.rst diff --git a/src/python/src/grpc/_cython/__init__.py b/src/python/grpcio/grpc/_cython/__init__.py index b89398809f..b89398809f 100644 --- a/src/python/src/grpc/_cython/__init__.py +++ b/src/python/grpcio/grpc/_cython/__init__.py diff --git a/src/python/src/grpc/_cython/_cygrpc/__init__.py b/src/python/grpcio/grpc/_cython/_cygrpc/__init__.py index b89398809f..b89398809f 100644 --- a/src/python/src/grpc/_cython/_cygrpc/__init__.py +++ b/src/python/grpcio/grpc/_cython/_cygrpc/__init__.py diff --git a/src/python/src/grpc/_cython/_cygrpc/call.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/call.pxd index fe9b81e3d3..fe9b81e3d3 100644 --- a/src/python/src/grpc/_cython/_cygrpc/call.pxd +++ b/src/python/grpcio/grpc/_cython/_cygrpc/call.pxd diff --git a/src/python/src/grpc/_cython/_cygrpc/call.pyx b/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx index 4349786b3a..4349786b3a 100644 --- a/src/python/src/grpc/_cython/_cygrpc/call.pyx +++ b/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx diff --git a/src/python/src/grpc/_cython/_cygrpc/channel.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd index 3e341bf222..3e341bf222 100644 --- a/src/python/src/grpc/_cython/_cygrpc/channel.pxd +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd diff --git a/src/python/src/grpc/_cython/_cygrpc/channel.pyx b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx index b20313818d..b20313818d 100644 --- a/src/python/src/grpc/_cython/_cygrpc/channel.pyx +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx diff --git a/src/python/src/grpc/_cython/_cygrpc/completion_queue.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd index fd562ad75b..fd562ad75b 100644 --- a/src/python/src/grpc/_cython/_cygrpc/completion_queue.pxd +++ b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd diff --git a/src/python/src/grpc/_cython/_cygrpc/completion_queue.pyx b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx index 886d85360a..886d85360a 100644 --- a/src/python/src/grpc/_cython/_cygrpc/completion_queue.pyx +++ b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx diff --git a/src/python/src/grpc/_cython/_cygrpc/credentials.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd index 6b74a267e0..6b74a267e0 100644 --- a/src/python/src/grpc/_cython/_cygrpc/credentials.pxd +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd diff --git a/src/python/src/grpc/_cython/_cygrpc/credentials.pyx b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx index 2d74702fbd..2d74702fbd 100644 --- a/src/python/src/grpc/_cython/_cygrpc/credentials.pyx +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx diff --git a/src/python/src/grpc/_cython/_cygrpc/grpc.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxd index d065383587..d065383587 100644 --- a/src/python/src/grpc/_cython/_cygrpc/grpc.pxd +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxd diff --git a/src/python/src/grpc/_cython/_cygrpc/records.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/records.pxd index 9ee487882a..9ee487882a 100644 --- a/src/python/src/grpc/_cython/_cygrpc/records.pxd +++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pxd diff --git a/src/python/src/grpc/_cython/_cygrpc/records.pyx b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx index 4814769fd2..4814769fd2 100644 --- a/src/python/src/grpc/_cython/_cygrpc/records.pyx +++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx diff --git a/src/python/src/grpc/_cython/_cygrpc/server.pxd b/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd index 0257542a03..0257542a03 100644 --- a/src/python/src/grpc/_cython/_cygrpc/server.pxd +++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd diff --git a/src/python/src/grpc/_cython/_cygrpc/server.pyx b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx index dcf9d38337..dcf9d38337 100644 --- a/src/python/src/grpc/_cython/_cygrpc/server.pyx +++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx diff --git a/src/python/src/grpc/_cython/adapter_low.py b/src/python/grpcio/grpc/_cython/adapter_low.py index 2bb468eece..2bb468eece 100644 --- a/src/python/src/grpc/_cython/adapter_low.py +++ b/src/python/grpcio/grpc/_cython/adapter_low.py diff --git a/src/python/src/grpc/_cython/cygrpc.pyx b/src/python/grpcio/grpc/_cython/cygrpc.pyx index f4d9661580..f4d9661580 100644 --- a/src/python/src/grpc/_cython/cygrpc.pyx +++ b/src/python/grpcio/grpc/_cython/cygrpc.pyx diff --git a/src/python/src/grpc/_adapter/__init__.py b/src/python/grpcio/grpc/_links/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/_adapter/__init__.py +++ b/src/python/grpcio/grpc/_links/__init__.py diff --git a/src/python/src/grpc/_links/invocation.py b/src/python/grpcio/grpc/_links/invocation.py index 0058ae91f8..0058ae91f8 100644 --- a/src/python/src/grpc/_links/invocation.py +++ b/src/python/grpcio/grpc/_links/invocation.py diff --git a/src/python/src/grpc/_links/service.py b/src/python/grpcio/grpc/_links/service.py index 7783e91824..7783e91824 100644 --- a/src/python/src/grpc/_links/service.py +++ b/src/python/grpcio/grpc/_links/service.py diff --git a/src/python/src/grpc/_junkdrawer/__init__.py b/src/python/grpcio/grpc/early_adopter/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/_junkdrawer/__init__.py +++ b/src/python/grpcio/grpc/early_adopter/__init__.py diff --git a/src/python/src/grpc/early_adopter/implementations.py b/src/python/grpcio/grpc/early_adopter/implementations.py index 10919fae69..10919fae69 100644 --- a/src/python/src/grpc/early_adopter/implementations.py +++ b/src/python/grpcio/grpc/early_adopter/implementations.py diff --git a/src/python/src/grpc/_links/__init__.py b/src/python/grpcio/grpc/framework/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/_links/__init__.py +++ b/src/python/grpcio/grpc/framework/__init__.py diff --git a/src/python/src/grpc/framework/alpha/__init__.py b/src/python/grpcio/grpc/framework/alpha/__init__.py index b89398809f..b89398809f 100644 --- a/src/python/src/grpc/framework/alpha/__init__.py +++ b/src/python/grpcio/grpc/framework/alpha/__init__.py diff --git a/src/python/src/grpc/framework/alpha/_face_utilities.py b/src/python/grpcio/grpc/framework/alpha/_face_utilities.py index fb0cfe426d..fb0cfe426d 100644 --- a/src/python/src/grpc/framework/alpha/_face_utilities.py +++ b/src/python/grpcio/grpc/framework/alpha/_face_utilities.py diff --git a/src/python/src/grpc/framework/alpha/_reexport.py b/src/python/grpcio/grpc/framework/alpha/_reexport.py index 198cb95ad5..198cb95ad5 100644 --- a/src/python/src/grpc/framework/alpha/_reexport.py +++ b/src/python/grpcio/grpc/framework/alpha/_reexport.py diff --git a/src/python/src/grpc/framework/alpha/exceptions.py b/src/python/grpcio/grpc/framework/alpha/exceptions.py index 5234d3b91c..5234d3b91c 100644 --- a/src/python/src/grpc/framework/alpha/exceptions.py +++ b/src/python/grpcio/grpc/framework/alpha/exceptions.py diff --git a/src/python/src/grpc/framework/alpha/interfaces.py b/src/python/grpcio/grpc/framework/alpha/interfaces.py index 8380567c97..8380567c97 100644 --- a/src/python/src/grpc/framework/alpha/interfaces.py +++ b/src/python/grpcio/grpc/framework/alpha/interfaces.py diff --git a/src/python/src/grpc/framework/alpha/utilities.py b/src/python/grpcio/grpc/framework/alpha/utilities.py index 7d7f78f5e4..7d7f78f5e4 100644 --- a/src/python/src/grpc/framework/alpha/utilities.py +++ b/src/python/grpcio/grpc/framework/alpha/utilities.py diff --git a/src/python/src/grpc/early_adopter/__init__.py b/src/python/grpcio/grpc/framework/base/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/early_adopter/__init__.py +++ b/src/python/grpcio/grpc/framework/base/__init__.py diff --git a/src/python/src/grpc/framework/base/_cancellation.py b/src/python/grpcio/grpc/framework/base/_cancellation.py index ffbc90668f..ffbc90668f 100644 --- a/src/python/src/grpc/framework/base/_cancellation.py +++ b/src/python/grpcio/grpc/framework/base/_cancellation.py diff --git a/src/python/src/grpc/framework/base/_constants.py b/src/python/grpcio/grpc/framework/base/_constants.py index 8fbdc82782..8fbdc82782 100644 --- a/src/python/src/grpc/framework/base/_constants.py +++ b/src/python/grpcio/grpc/framework/base/_constants.py diff --git a/src/python/src/grpc/framework/base/_context.py b/src/python/grpcio/grpc/framework/base/_context.py index d84871d639..d84871d639 100644 --- a/src/python/src/grpc/framework/base/_context.py +++ b/src/python/grpcio/grpc/framework/base/_context.py diff --git a/src/python/src/grpc/framework/base/_emission.py b/src/python/grpcio/grpc/framework/base/_emission.py index 1829669a72..1829669a72 100644 --- a/src/python/src/grpc/framework/base/_emission.py +++ b/src/python/grpcio/grpc/framework/base/_emission.py diff --git a/src/python/src/grpc/framework/base/_ends.py b/src/python/grpcio/grpc/framework/base/_ends.py index 176f3ac06e..176f3ac06e 100644 --- a/src/python/src/grpc/framework/base/_ends.py +++ b/src/python/grpcio/grpc/framework/base/_ends.py diff --git a/src/python/src/grpc/framework/base/_expiration.py b/src/python/grpcio/grpc/framework/base/_expiration.py index 17acbef4c1..17acbef4c1 100644 --- a/src/python/src/grpc/framework/base/_expiration.py +++ b/src/python/grpcio/grpc/framework/base/_expiration.py diff --git a/src/python/src/grpc/framework/base/_ingestion.py b/src/python/grpcio/grpc/framework/base/_ingestion.py index 06d5b92f0b..06d5b92f0b 100644 --- a/src/python/src/grpc/framework/base/_ingestion.py +++ b/src/python/grpcio/grpc/framework/base/_ingestion.py diff --git a/src/python/src/grpc/framework/base/_interfaces.py b/src/python/grpcio/grpc/framework/base/_interfaces.py index d88cf76590..d88cf76590 100644 --- a/src/python/src/grpc/framework/base/_interfaces.py +++ b/src/python/grpcio/grpc/framework/base/_interfaces.py diff --git a/src/python/src/grpc/framework/base/_reception.py b/src/python/grpcio/grpc/framework/base/_reception.py index dd428964f1..dd428964f1 100644 --- a/src/python/src/grpc/framework/base/_reception.py +++ b/src/python/grpcio/grpc/framework/base/_reception.py diff --git a/src/python/src/grpc/framework/base/_termination.py b/src/python/grpcio/grpc/framework/base/_termination.py index ddcbc60293..ddcbc60293 100644 --- a/src/python/src/grpc/framework/base/_termination.py +++ b/src/python/grpcio/grpc/framework/base/_termination.py diff --git a/src/python/src/grpc/framework/base/_transmission.py b/src/python/grpcio/grpc/framework/base/_transmission.py index 6845129234..6845129234 100644 --- a/src/python/src/grpc/framework/base/_transmission.py +++ b/src/python/grpcio/grpc/framework/base/_transmission.py diff --git a/src/python/src/grpc/framework/base/exceptions.py b/src/python/grpcio/grpc/framework/base/exceptions.py index b8f4752184..b8f4752184 100644 --- a/src/python/src/grpc/framework/base/exceptions.py +++ b/src/python/grpcio/grpc/framework/base/exceptions.py diff --git a/src/python/src/grpc/framework/base/implementations.py b/src/python/grpcio/grpc/framework/base/implementations.py index 5656f9f981..5656f9f981 100644 --- a/src/python/src/grpc/framework/base/implementations.py +++ b/src/python/grpcio/grpc/framework/base/implementations.py diff --git a/src/python/src/grpc/framework/base/in_memory.py b/src/python/grpcio/grpc/framework/base/in_memory.py index c92d0bc663..c92d0bc663 100644 --- a/src/python/src/grpc/framework/base/in_memory.py +++ b/src/python/grpcio/grpc/framework/base/in_memory.py diff --git a/src/python/src/grpc/framework/base/interfaces.py b/src/python/grpcio/grpc/framework/base/interfaces.py index e22c10d975..e22c10d975 100644 --- a/src/python/src/grpc/framework/base/interfaces.py +++ b/src/python/grpcio/grpc/framework/base/interfaces.py diff --git a/src/python/src/grpc/framework/base/null.py b/src/python/grpcio/grpc/framework/base/null.py index 1e30d4557b..1e30d4557b 100644 --- a/src/python/src/grpc/framework/base/null.py +++ b/src/python/grpcio/grpc/framework/base/null.py diff --git a/src/python/src/grpc/framework/base/util.py b/src/python/grpcio/grpc/framework/base/util.py index c832c826cf..c832c826cf 100644 --- a/src/python/src/grpc/framework/base/util.py +++ b/src/python/grpcio/grpc/framework/base/util.py diff --git a/src/python/src/grpc/framework/__init__.py b/src/python/grpcio/grpc/framework/common/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/framework/__init__.py +++ b/src/python/grpcio/grpc/framework/common/__init__.py diff --git a/src/python/src/grpc/framework/common/cardinality.py b/src/python/grpcio/grpc/framework/common/cardinality.py index 610425e803..610425e803 100644 --- a/src/python/src/grpc/framework/common/cardinality.py +++ b/src/python/grpcio/grpc/framework/common/cardinality.py diff --git a/src/python/src/grpc/framework/common/style.py b/src/python/grpcio/grpc/framework/common/style.py index 6ae694bdcb..6ae694bdcb 100644 --- a/src/python/src/grpc/framework/common/style.py +++ b/src/python/grpcio/grpc/framework/common/style.py diff --git a/src/python/src/grpc/framework/base/__init__.py b/src/python/grpcio/grpc/framework/face/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/framework/base/__init__.py +++ b/src/python/grpcio/grpc/framework/face/__init__.py diff --git a/src/python/src/grpc/framework/face/_calls.py b/src/python/grpcio/grpc/framework/face/_calls.py index 87edeb0f0e..87edeb0f0e 100644 --- a/src/python/src/grpc/framework/face/_calls.py +++ b/src/python/grpcio/grpc/framework/face/_calls.py diff --git a/src/python/src/grpc/framework/face/_control.py b/src/python/grpcio/grpc/framework/face/_control.py index e918907b74..e918907b74 100644 --- a/src/python/src/grpc/framework/face/_control.py +++ b/src/python/grpcio/grpc/framework/face/_control.py diff --git a/src/python/src/grpc/framework/face/_service.py b/src/python/grpcio/grpc/framework/face/_service.py index cdf413356a..cdf413356a 100644 --- a/src/python/src/grpc/framework/face/_service.py +++ b/src/python/grpcio/grpc/framework/face/_service.py diff --git a/src/python/src/grpc/framework/face/demonstration.py b/src/python/grpcio/grpc/framework/face/demonstration.py index f6b4b609ff..f6b4b609ff 100644 --- a/src/python/src/grpc/framework/face/demonstration.py +++ b/src/python/grpcio/grpc/framework/face/demonstration.py diff --git a/src/python/src/grpc/framework/face/exceptions.py b/src/python/grpcio/grpc/framework/face/exceptions.py index f112df70bc..f112df70bc 100644 --- a/src/python/src/grpc/framework/face/exceptions.py +++ b/src/python/grpcio/grpc/framework/face/exceptions.py diff --git a/src/python/src/grpc/framework/face/implementations.py b/src/python/grpcio/grpc/framework/face/implementations.py index 4a6de52974..4a6de52974 100644 --- a/src/python/src/grpc/framework/face/implementations.py +++ b/src/python/grpcio/grpc/framework/face/implementations.py diff --git a/src/python/src/grpc/framework/face/interfaces.py b/src/python/grpcio/grpc/framework/face/interfaces.py index b7cc4c1169..b7cc4c1169 100644 --- a/src/python/src/grpc/framework/face/interfaces.py +++ b/src/python/grpcio/grpc/framework/face/interfaces.py diff --git a/src/python/src/grpc/framework/face/utilities.py b/src/python/grpcio/grpc/framework/face/utilities.py index a63fe8c60d..a63fe8c60d 100644 --- a/src/python/src/grpc/framework/face/utilities.py +++ b/src/python/grpcio/grpc/framework/face/utilities.py diff --git a/src/python/src/grpc/framework/common/__init__.py b/src/python/grpcio/grpc/framework/foundation/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/framework/common/__init__.py +++ b/src/python/grpcio/grpc/framework/foundation/__init__.py diff --git a/src/python/src/grpc/framework/foundation/_timer_future.py b/src/python/grpcio/grpc/framework/foundation/_timer_future.py index 2c9996aa9d..2c9996aa9d 100644 --- a/src/python/src/grpc/framework/foundation/_timer_future.py +++ b/src/python/grpcio/grpc/framework/foundation/_timer_future.py diff --git a/src/python/src/grpc/framework/foundation/abandonment.py b/src/python/grpcio/grpc/framework/foundation/abandonment.py index 960b4d06b4..960b4d06b4 100644 --- a/src/python/src/grpc/framework/foundation/abandonment.py +++ b/src/python/grpcio/grpc/framework/foundation/abandonment.py diff --git a/src/python/src/grpc/framework/foundation/activated.py b/src/python/grpcio/grpc/framework/foundation/activated.py index 426a71c705..426a71c705 100644 --- a/src/python/src/grpc/framework/foundation/activated.py +++ b/src/python/grpcio/grpc/framework/foundation/activated.py diff --git a/src/python/src/grpc/framework/foundation/callable_util.py b/src/python/grpcio/grpc/framework/foundation/callable_util.py index 32b0751a01..32b0751a01 100644 --- a/src/python/src/grpc/framework/foundation/callable_util.py +++ b/src/python/grpcio/grpc/framework/foundation/callable_util.py diff --git a/src/python/src/grpc/framework/foundation/future.py b/src/python/grpcio/grpc/framework/foundation/future.py index bfc16fc1ea..bfc16fc1ea 100644 --- a/src/python/src/grpc/framework/foundation/future.py +++ b/src/python/grpcio/grpc/framework/foundation/future.py diff --git a/src/python/src/grpc/framework/foundation/later.py b/src/python/grpcio/grpc/framework/foundation/later.py index 1d1e065041..1d1e065041 100644 --- a/src/python/src/grpc/framework/foundation/later.py +++ b/src/python/grpcio/grpc/framework/foundation/later.py diff --git a/src/python/src/grpc/framework/foundation/logging_pool.py b/src/python/grpcio/grpc/framework/foundation/logging_pool.py index 7c7a6eebfc..7c7a6eebfc 100644 --- a/src/python/src/grpc/framework/foundation/logging_pool.py +++ b/src/python/grpcio/grpc/framework/foundation/logging_pool.py diff --git a/src/python/src/grpc/framework/foundation/relay.py b/src/python/grpcio/grpc/framework/foundation/relay.py index 9c23946552..9c23946552 100644 --- a/src/python/src/grpc/framework/foundation/relay.py +++ b/src/python/grpcio/grpc/framework/foundation/relay.py diff --git a/src/python/src/grpc/framework/foundation/stream.py b/src/python/grpcio/grpc/framework/foundation/stream.py index 75c0cf145b..75c0cf145b 100644 --- a/src/python/src/grpc/framework/foundation/stream.py +++ b/src/python/grpcio/grpc/framework/foundation/stream.py diff --git a/src/python/src/grpc/framework/foundation/stream_util.py b/src/python/grpcio/grpc/framework/foundation/stream_util.py index 2210e4efcf..2210e4efcf 100644 --- a/src/python/src/grpc/framework/foundation/stream_util.py +++ b/src/python/grpcio/grpc/framework/foundation/stream_util.py diff --git a/src/python/src/grpc/framework/face/__init__.py b/src/python/grpcio/grpc/framework/interfaces/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/framework/face/__init__.py +++ b/src/python/grpcio/grpc/framework/interfaces/__init__.py diff --git a/src/python/src/grpc/framework/face/testing/__init__.py b/src/python/grpcio/grpc/framework/interfaces/links/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/framework/face/testing/__init__.py +++ b/src/python/grpcio/grpc/framework/interfaces/links/__init__.py diff --git a/src/python/src/grpc/framework/interfaces/links/links.py b/src/python/grpcio/grpc/framework/interfaces/links/links.py index 5ebbac8a6f..5ebbac8a6f 100644 --- a/src/python/src/grpc/framework/interfaces/links/links.py +++ b/src/python/grpcio/grpc/framework/interfaces/links/links.py diff --git a/src/python/src/grpc/framework/interfaces/links/utilities.py b/src/python/grpcio/grpc/framework/interfaces/links/utilities.py index 6e4fd76d93..6e4fd76d93 100644 --- a/src/python/src/grpc/framework/interfaces/links/utilities.py +++ b/src/python/grpcio/grpc/framework/interfaces/links/utilities.py diff --git a/src/python/requirements.txt b/src/python/grpcio/requirements.txt index 43395df03b..43395df03b 100644 --- a/src/python/requirements.txt +++ b/src/python/grpcio/requirements.txt diff --git a/src/python/src/setup.cfg b/src/python/grpcio/setup.cfg index 8f69613632..8f69613632 100644 --- a/src/python/src/setup.cfg +++ b/src/python/grpcio/setup.cfg diff --git a/src/python/src/setup.py b/src/python/grpcio/setup.py index 0310a83a7b..e408f2ace9 100644 --- a/src/python/src/setup.py +++ b/src/python/grpcio/setup.py @@ -79,35 +79,17 @@ _C_EXTENSION_MODULE = _core.Extension( _EXTENSION_MODULES = [_C_EXTENSION_MODULE] _PACKAGES = ( - 'grpc', - 'grpc._adapter', - 'grpc._junkdrawer', - 'grpc._links', - 'grpc.early_adopter', - 'grpc.framework', - 'grpc.framework.alpha', - 'grpc.framework.base', - 'grpc.framework.common', - 'grpc.framework.face', - 'grpc.framework.face.testing', - 'grpc.framework.foundation', - 'grpc.framework.interfaces', - 'grpc.framework.interfaces.links', + setuptools.find_packages('.', exclude=['*._cython', '*._cython.*']) ) _PACKAGE_DIRECTORIES = { - 'grpc': 'grpc', - 'grpc._adapter': 'grpc/_adapter', - 'grpc._junkdrawer': 'grpc/_junkdrawer', - 'grpc._links': 'grpc/_links', - 'grpc.early_adopter': 'grpc/early_adopter', - 'grpc.framework': 'grpc/framework', + '': '.', } _INSTALL_REQUIRES = ( 'enum34==1.0.4', 'futures==2.2.0', - 'protobuf==3.0.0a3' + 'protobuf==3.0.0a3', ) _SETUP_REQUIRES = ( @@ -115,7 +97,7 @@ _SETUP_REQUIRES = ( ) + _INSTALL_REQUIRES _COMMAND_CLASS = { - 'doc': commands.SphinxDocumentation + 'doc': commands.SphinxDocumentation, } setuptools.setup( diff --git a/src/python/grpcio_test/.gitignore b/src/python/grpcio_test/.gitignore new file mode 100644 index 0000000000..218e3a15ab --- /dev/null +++ b/src/python/grpcio_test/.gitignore @@ -0,0 +1,10 @@ +MANIFEST +*.egg-info/ +build/ +dist/ +*.egg +*.egg/ +*.eggs/ +.coverage +.coverage.* +nosetests.xml diff --git a/src/python/grpcio_test/MANIFEST.in b/src/python/grpcio_test/MANIFEST.in new file mode 100644 index 0000000000..c9327307dc --- /dev/null +++ b/src/python/grpcio_test/MANIFEST.in @@ -0,0 +1,4 @@ +graft grpc_interop +graft grpc_test +include commands.py +include requirements.txt diff --git a/src/python/grpcio_test/commands.py b/src/python/grpcio_test/commands.py new file mode 100644 index 0000000000..c796d94c76 --- /dev/null +++ b/src/python/grpcio_test/commands.py @@ -0,0 +1,57 @@ +# 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. + +"""Provides distutils command classes for the GRPC Python test setup process.""" + +import os +import os.path +import sys + +import setuptools + + +class RunTests(setuptools.Command): + """Command to run all tests via py.test.""" + + description = '' + user_options = [('pytest-args=', 'a', 'arguments to pass to py.test')] + + def initialize_options(self): + self.pytest_args = [] + + def finalize_options(self): + pass + + def run(self): + # We import here to ensure that setup.py has had a chance to install the + # relevant package eggs first. + import pytest + result = pytest.main(self.pytest_args) + if result != 0: + raise SystemExit(result) diff --git a/src/python/src/grpc/framework/foundation/__init__.py b/src/python/grpcio_test/grpc_interop/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/framework/foundation/__init__.py +++ b/src/python/grpcio_test/grpc_interop/__init__.py diff --git a/src/python/interop/interop/_insecure_interop_test.py b/src/python/grpcio_test/grpc_interop/_insecure_interop_test.py index 98ea3a6648..825988a072 100644 --- a/src/python/interop/interop/_insecure_interop_test.py +++ b/src/python/grpcio_test/grpc_interop/_insecure_interop_test.py @@ -33,8 +33,8 @@ import unittest from grpc.early_adopter import implementations -from interop import _interop_test_case -from interop import methods +from grpc_interop import _interop_test_case +from grpc_interop import methods class InsecureInteropTest( diff --git a/src/python/interop/interop/_interop_test_case.py b/src/python/grpcio_test/grpc_interop/_interop_test_case.py index f40ef0ec83..ed8f7ef009 100644 --- a/src/python/interop/interop/_interop_test_case.py +++ b/src/python/grpcio_test/grpc_interop/_interop_test_case.py @@ -29,7 +29,7 @@ """Common code for unit tests of the interoperability test code.""" -from interop import methods +from grpc_interop import methods class InteropTestCase(object): diff --git a/src/python/interop/interop/_secure_interop_test.py b/src/python/grpcio_test/grpc_interop/_secure_interop_test.py index be7618f549..a2682dee99 100644 --- a/src/python/interop/interop/_secure_interop_test.py +++ b/src/python/grpcio_test/grpc_interop/_secure_interop_test.py @@ -33,9 +33,9 @@ import unittest from grpc.early_adopter import implementations -from interop import _interop_test_case -from interop import methods -from interop import resources +from grpc_interop import _interop_test_case +from grpc_interop import methods +from grpc_interop import resources _SERVER_HOST_OVERRIDE = 'foo.test.google.fr' diff --git a/src/python/interop/interop/client.py b/src/python/grpcio_test/grpc_interop/client.py index 41f0d94539..2dd2103cbe 100644 --- a/src/python/interop/interop/client.py +++ b/src/python/grpcio_test/grpc_interop/client.py @@ -34,8 +34,8 @@ from oauth2client import client as oauth2client_client from grpc.early_adopter import implementations -from interop import methods -from interop import resources +from grpc_interop import methods +from grpc_interop import resources _ONE_DAY_IN_SECONDS = 60 * 60 * 24 diff --git a/src/python/interop/interop/credentials/README b/src/python/grpcio_test/grpc_interop/credentials/README index cb20dcb49f..cb20dcb49f 100644 --- a/src/python/interop/interop/credentials/README +++ b/src/python/grpcio_test/grpc_interop/credentials/README diff --git a/src/python/interop/interop/credentials/ca.pem b/src/python/grpcio_test/grpc_interop/credentials/ca.pem index 6c8511a73c..6c8511a73c 100755 --- a/src/python/interop/interop/credentials/ca.pem +++ b/src/python/grpcio_test/grpc_interop/credentials/ca.pem diff --git a/src/python/interop/interop/credentials/server1.key b/src/python/grpcio_test/grpc_interop/credentials/server1.key index 143a5b8765..143a5b8765 100755 --- a/src/python/interop/interop/credentials/server1.key +++ b/src/python/grpcio_test/grpc_interop/credentials/server1.key diff --git a/src/python/interop/interop/credentials/server1.pem b/src/python/grpcio_test/grpc_interop/credentials/server1.pem index 8e582e571f..8e582e571f 100755 --- a/src/python/interop/interop/credentials/server1.pem +++ b/src/python/grpcio_test/grpc_interop/credentials/server1.pem diff --git a/src/python/interop/interop/empty_pb2.py b/src/python/grpcio_test/grpc_interop/empty_pb2.py index 8c1ce2f13e..8c1ce2f13e 100644 --- a/src/python/interop/interop/empty_pb2.py +++ b/src/python/grpcio_test/grpc_interop/empty_pb2.py diff --git a/src/python/interop/interop/messages_pb2.py b/src/python/grpcio_test/grpc_interop/messages_pb2.py index 0bf3d86a31..0bf3d86a31 100644 --- a/src/python/interop/interop/messages_pb2.py +++ b/src/python/grpcio_test/grpc_interop/messages_pb2.py diff --git a/src/python/interop/interop/methods.py b/src/python/grpcio_test/grpc_interop/methods.py index 194afadb17..f4c94685ee 100644 --- a/src/python/interop/interop/methods.py +++ b/src/python/grpcio_test/grpc_interop/methods.py @@ -38,8 +38,8 @@ from oauth2client import client as oauth2client_client from grpc.framework.alpha import utilities -from interop import empty_pb2 -from interop import messages_pb2 +from grpc_interop import empty_pb2 +from grpc_interop import messages_pb2 _TIMEOUT = 7 diff --git a/src/python/interop/interop/resources.py b/src/python/grpcio_test/grpc_interop/resources.py index 2c3045313d..2c3045313d 100644 --- a/src/python/interop/interop/resources.py +++ b/src/python/grpcio_test/grpc_interop/resources.py diff --git a/src/python/interop/interop/server.py b/src/python/grpcio_test/grpc_interop/server.py index a67d412038..60f630a6be 100644 --- a/src/python/interop/interop/server.py +++ b/src/python/grpcio_test/grpc_interop/server.py @@ -35,8 +35,8 @@ import time from grpc.early_adopter import implementations -from interop import methods -from interop import resources +from grpc_interop import methods +from grpc_interop import resources _ONE_DAY_IN_SECONDS = 60 * 60 * 24 diff --git a/src/python/interop/interop/test_pb2.py b/src/python/grpcio_test/grpc_interop/test_pb2.py index 71325d5a9f..71325d5a9f 100644 --- a/src/python/interop/interop/test_pb2.py +++ b/src/python/grpcio_test/grpc_interop/test_pb2.py diff --git a/src/python/src/grpc/framework/interfaces/__init__.py b/src/python/grpcio_test/grpc_test/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/framework/interfaces/__init__.py +++ b/src/python/grpcio_test/grpc_test/__init__.py diff --git a/src/python/grpcio_test/grpc_test/_adapter/.gitignore b/src/python/grpcio_test/grpc_test/_adapter/.gitignore new file mode 100644 index 0000000000..a6f96cd6db --- /dev/null +++ b/src/python/grpcio_test/grpc_test/_adapter/.gitignore @@ -0,0 +1,5 @@ +*.a +*.so +*.dll +*.pyc +*.pyd diff --git a/src/python/src/grpc/framework/interfaces/links/__init__.py b/src/python/grpcio_test/grpc_test/_adapter/__init__.py index 7086519106..7086519106 100644 --- a/src/python/src/grpc/framework/interfaces/links/__init__.py +++ b/src/python/grpcio_test/grpc_test/_adapter/__init__.py diff --git a/src/python/src/grpc/_adapter/_blocking_invocation_inline_service_test.py b/src/python/grpcio_test/grpc_test/_adapter/_blocking_invocation_inline_service_test.py index 7a8ff0ad89..a1f776211c 100644 --- a/src/python/src/grpc/_adapter/_blocking_invocation_inline_service_test.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_blocking_invocation_inline_service_test.py @@ -31,8 +31,8 @@ import unittest -from grpc._adapter import _face_test_case -from grpc.framework.face.testing import blocking_invocation_inline_service_test_case as test_case +from grpc_test._adapter import _face_test_case +from grpc_test.framework.face.testing import blocking_invocation_inline_service_test_case as test_case class BlockingInvocationInlineServiceTest( diff --git a/src/python/src/grpc/_adapter/_c_test.py b/src/python/grpcio_test/grpc_test/_adapter/_c_test.py index fe020e2a9c..fe020e2a9c 100644 --- a/src/python/src/grpc/_adapter/_c_test.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_c_test.py diff --git a/src/python/src/grpc/_adapter/_event_invocation_synchronous_event_service_test.py b/src/python/grpcio_test/grpc_test/_adapter/_event_invocation_synchronous_event_service_test.py index b8ceb75d68..0d01ebc8dc 100644 --- a/src/python/src/grpc/_adapter/_event_invocation_synchronous_event_service_test.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_event_invocation_synchronous_event_service_test.py @@ -31,8 +31,8 @@ import unittest -from grpc._adapter import _face_test_case -from grpc.framework.face.testing import event_invocation_synchronous_event_service_test_case as test_case +from grpc_test._adapter import _face_test_case +from grpc_test.framework.face.testing import event_invocation_synchronous_event_service_test_case as test_case class EventInvocationSynchronousEventServiceTest( diff --git a/src/python/src/grpc/_adapter/_face_test_case.py b/src/python/grpcio_test/grpc_test/_adapter/_face_test_case.py index 5fa974ed06..dfbd0b60af 100644 --- a/src/python/src/grpc/_adapter/_face_test_case.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_face_test_case.py @@ -36,10 +36,10 @@ from grpc._adapter import rear from grpc.framework.base import util from grpc.framework.base import implementations as base_implementations from grpc.framework.face import implementations as face_implementations -from grpc.framework.face.testing import coverage -from grpc.framework.face.testing import serial -from grpc.framework.face.testing import test_case from grpc.framework.foundation import logging_pool +from grpc_test.framework.face.testing import coverage +from grpc_test.framework.face.testing import serial +from grpc_test.framework.face.testing import test_case _TIMEOUT = 3 _MAXIMUM_TIMEOUT = 90 diff --git a/src/python/src/grpc/_adapter/_future_invocation_asynchronous_event_service_test.py b/src/python/grpcio_test/grpc_test/_adapter/_future_invocation_asynchronous_event_service_test.py index 3773e65575..ea4a6a0bae 100644 --- a/src/python/src/grpc/_adapter/_future_invocation_asynchronous_event_service_test.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_future_invocation_asynchronous_event_service_test.py @@ -31,8 +31,8 @@ import unittest -from grpc._adapter import _face_test_case -from grpc.framework.face.testing import future_invocation_asynchronous_event_service_test_case as test_case +from grpc_test._adapter import _face_test_case +from grpc_test.framework.face.testing import future_invocation_asynchronous_event_service_test_case as test_case class FutureInvocationAsynchronousEventServiceTest( diff --git a/src/python/src/grpc/_adapter/_intermediary_low_test.py b/src/python/grpcio_test/grpc_test/_adapter/_intermediary_low_test.py index 27a5b82e9c..27a5b82e9c 100644 --- a/src/python/src/grpc/_adapter/_intermediary_low_test.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_intermediary_low_test.py diff --git a/src/python/src/grpc/_adapter/_links_test.py b/src/python/grpcio_test/grpc_test/_adapter/_links_test.py index 4729b84f84..c4686b327a 100644 --- a/src/python/src/grpc/_adapter/_links_test.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_links_test.py @@ -32,12 +32,12 @@ import threading import unittest -from grpc._adapter import _proto_scenarios -from grpc._adapter import _test_links from grpc._adapter import fore from grpc._adapter import rear from grpc.framework.base import interfaces from grpc.framework.foundation import logging_pool +from grpc_test._adapter import _proto_scenarios +from grpc_test._adapter import _test_links _IDENTITY = lambda x: x _TIMEOUT = 32 diff --git a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py b/src/python/grpcio_test/grpc_test/_adapter/_lonely_rear_link_test.py index 7f5021f40e..9b5758f60f 100644 --- a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_lonely_rear_link_test.py @@ -31,10 +31,10 @@ import unittest -from grpc._adapter import _test_links from grpc._adapter import rear from grpc.framework.base import interfaces from grpc.framework.foundation import logging_pool +from grpc_test._adapter import _test_links _IDENTITY = lambda x: x _TIMEOUT = 2 diff --git a/src/python/src/grpc/_adapter/_low_test.py b/src/python/grpcio_test/grpc_test/_adapter/_low_test.py index 9a8edfad0c..9a8edfad0c 100644 --- a/src/python/src/grpc/_adapter/_low_test.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_low_test.py diff --git a/src/python/src/grpc/_adapter/_proto_scenarios.py b/src/python/grpcio_test/grpc_test/_adapter/_proto_scenarios.py index 60a622ba8b..b3d6ec8607 100644 --- a/src/python/src/grpc/_adapter/_proto_scenarios.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_proto_scenarios.py @@ -32,7 +32,7 @@ import abc import threading -from grpc._junkdrawer import math_pb2 +from grpc_test._junkdrawer import math_pb2 class ProtoScenario(object): diff --git a/src/python/src/grpc/_adapter/_test_links.py b/src/python/grpcio_test/grpc_test/_adapter/_test_links.py index 86c7e61b17..86c7e61b17 100644 --- a/src/python/src/grpc/_adapter/_test_links.py +++ b/src/python/grpcio_test/grpc_test/_adapter/_test_links.py diff --git a/src/python/grpcio_test/grpc_test/_cython/.gitignore b/src/python/grpcio_test/grpc_test/_cython/.gitignore new file mode 100644 index 0000000000..c315029288 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/_cython/.gitignore @@ -0,0 +1,7 @@ +*.h +*.c +*.a +*.so +*.dll +*.pyc +*.pyd diff --git a/src/python/grpcio_test/grpc_test/_cython/__init__.py b/src/python/grpcio_test/grpc_test/_cython/__init__.py new file mode 100644 index 0000000000..b89398809f --- /dev/null +++ b/src/python/grpcio_test/grpc_test/_cython/__init__.py @@ -0,0 +1,28 @@ +# 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. diff --git a/src/python/src/grpc/_cython/adapter_low_test.py b/src/python/grpcio_test/grpc_test/_cython/adapter_low_test.py index 9bab930e56..9bab930e56 100644 --- a/src/python/src/grpc/_cython/adapter_low_test.py +++ b/src/python/grpcio_test/grpc_test/_cython/adapter_low_test.py diff --git a/src/python/src/grpc/_cython/cygrpc_test.py b/src/python/grpcio_test/grpc_test/_cython/cygrpc_test.py index 22d210b16b..637506b42e 100644 --- a/src/python/src/grpc/_cython/cygrpc_test.py +++ b/src/python/grpcio_test/grpc_test/_cython/cygrpc_test.py @@ -31,7 +31,7 @@ import time import unittest from grpc._cython import cygrpc -from grpc._cython import test_utilities +from grpc_test._cython import test_utilities class TypeSmokeTest(unittest.TestCase): diff --git a/src/python/src/grpc/_cython/test_utilities.py b/src/python/grpcio_test/grpc_test/_cython/test_utilities.py index 21ea3075b4..21ea3075b4 100644 --- a/src/python/src/grpc/_cython/test_utilities.py +++ b/src/python/grpcio_test/grpc_test/_cython/test_utilities.py diff --git a/src/python/interop/setup.py b/src/python/grpcio_test/grpc_test/_junkdrawer/__init__.py index 75012b0d8f..7086519106 100644 --- a/src/python/interop/setup.py +++ b/src/python/grpcio_test/grpc_test/_junkdrawer/__init__.py @@ -27,31 +27,4 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""A setup module for the GRPC Python interop testing package.""" -import setuptools - -_PACKAGES = ( - 'interop', -) - -_PACKAGE_DIRECTORIES = { - 'interop': 'interop', -} - -_PACKAGE_DATA = { - 'interop': [ - 'credentials/ca.pem', 'credentials/server1.key', - 'credentials/server1.pem',] -} - -_INSTALL_REQUIRES = ['oauth2client>=1.4.7', 'grpcio>=0.10.0a0'] - -setuptools.setup( - name='interop', - version='0.0.1', - packages=_PACKAGES, - package_dir=_PACKAGE_DIRECTORIES, - package_data=_PACKAGE_DATA, - install_requires=_INSTALL_REQUIRES -) diff --git a/src/python/src/grpc/_junkdrawer/math_pb2.py b/src/python/grpcio_test/grpc_test/_junkdrawer/math_pb2.py index 20165955b4..20165955b4 100644 --- a/src/python/src/grpc/_junkdrawer/math_pb2.py +++ b/src/python/grpcio_test/grpc_test/_junkdrawer/math_pb2.py diff --git a/src/python/src/grpc/_junkdrawer/stock_pb2.py b/src/python/grpcio_test/grpc_test/_junkdrawer/stock_pb2.py index eef18f82d6..eef18f82d6 100644 --- a/src/python/src/grpc/_junkdrawer/stock_pb2.py +++ b/src/python/grpcio_test/grpc_test/_junkdrawer/stock_pb2.py diff --git a/src/python/grpcio_test/grpc_test/_links/__init__.py b/src/python/grpcio_test/grpc_test/_links/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/_links/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/src/grpc/_links/_lonely_invocation_link_test.py b/src/python/grpcio_test/grpc_test/_links/_lonely_invocation_link_test.py index 3d629f4387..abe240e07a 100644 --- a/src/python/src/grpc/_links/_lonely_invocation_link_test.py +++ b/src/python/grpcio_test/grpc_test/_links/_lonely_invocation_link_test.py @@ -33,10 +33,10 @@ import unittest from grpc._adapter import _intermediary_low from grpc._links import invocation -from grpc.framework.common import test_constants from grpc.framework.interfaces.links import links -from grpc.framework.interfaces.links import test_cases -from grpc.framework.interfaces.links import test_utilities +from grpc_test.framework.common import test_constants +from grpc_test.framework.interfaces.links import test_cases +from grpc_test.framework.interfaces.links import test_utilities _NULL_BEHAVIOR = lambda unused_argument: None diff --git a/src/python/src/grpc/_links/_proto_scenarios.py b/src/python/grpcio_test/grpc_test/_links/_proto_scenarios.py index 320c0e0f50..0d74d66297 100644 --- a/src/python/src/grpc/_links/_proto_scenarios.py +++ b/src/python/grpcio_test/grpc_test/_links/_proto_scenarios.py @@ -32,8 +32,8 @@ import abc import threading -from grpc._junkdrawer import math_pb2 -from grpc.framework.common import test_constants +from grpc_test._junkdrawer import math_pb2 +from grpc_test.framework.common import test_constants class ProtoScenario(object): diff --git a/src/python/src/grpc/_links/_transmission_test.py b/src/python/grpcio_test/grpc_test/_links/_transmission_test.py index 3eeec03f46..0531fa1d33 100644 --- a/src/python/src/grpc/_links/_transmission_test.py +++ b/src/python/grpcio_test/grpc_test/_links/_transmission_test.py @@ -32,13 +32,13 @@ import unittest from grpc._adapter import _intermediary_low -from grpc._links import _proto_scenarios from grpc._links import invocation from grpc._links import service -from grpc.framework.common import test_constants from grpc.framework.interfaces.links import links -from grpc.framework.interfaces.links import test_cases -from grpc.framework.interfaces.links import test_utilities +from grpc_test._links import _proto_scenarios +from grpc_test.framework.common import test_constants +from grpc_test.framework.interfaces.links import test_cases +from grpc_test.framework.interfaces.links import test_utilities _IDENTITY = lambda x: x diff --git a/src/python/grpcio_test/grpc_test/early_adopter/__init__.py b/src/python/grpcio_test/grpc_test/early_adopter/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/early_adopter/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/src/grpc/early_adopter/implementations_test.py b/src/python/grpcio_test/grpc_test/early_adopter/implementations_test.py index 49f0e949c4..611637e8b8 100644 --- a/src/python/src/grpc/early_adopter/implementations_test.py +++ b/src/python/grpcio_test/grpc_test/early_adopter/implementations_test.py @@ -35,7 +35,7 @@ import unittest from grpc.early_adopter import implementations from grpc.framework.alpha import utilities -from grpc._junkdrawer import math_pb2 +from grpc_test._junkdrawer import math_pb2 SERVICE_NAME = 'math.Math' diff --git a/src/python/grpcio_test/grpc_test/framework/__init__.py b/src/python/grpcio_test/grpc_test/framework/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/framework/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/grpcio_test/grpc_test/framework/base/__init__.py b/src/python/grpcio_test/grpc_test/framework/base/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/framework/base/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/src/grpc/framework/base/implementations_test.py b/src/python/grpcio_test/grpc_test/framework/base/implementations_test.py index 72087f4456..5a7d1398fd 100644 --- a/src/python/src/grpc/framework/base/implementations_test.py +++ b/src/python/grpcio_test/grpc_test/framework/base/implementations_test.py @@ -32,9 +32,9 @@ import unittest from grpc.framework.base import implementations -from grpc.framework.base import interfaces_test_case from grpc.framework.base import util from grpc.framework.foundation import logging_pool +from grpc_test.framework.base import interfaces_test_case POOL_MAX_WORKERS = 10 DEFAULT_TIMEOUT = 30 diff --git a/src/python/src/grpc/framework/base/interfaces_test_case.py b/src/python/grpcio_test/grpc_test/framework/base/interfaces_test_case.py index dec10c2924..be775ad4e0 100644 --- a/src/python/src/grpc/framework/base/interfaces_test_case.py +++ b/src/python/grpcio_test/grpc_test/framework/base/interfaces_test_case.py @@ -35,8 +35,8 @@ import time from grpc.framework.base import interfaces from grpc.framework.base import util from grpc.framework.foundation import stream -from grpc.framework.foundation import stream_testing from grpc.framework.foundation import stream_util +from grpc_test.framework.foundation import stream_testing TICK = 0.1 SMALL_TIMEOUT = TICK * 50 diff --git a/src/python/grpcio_test/grpc_test/framework/common/__init__.py b/src/python/grpcio_test/grpc_test/framework/common/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/framework/common/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/src/grpc/framework/common/test_constants.py b/src/python/grpcio_test/grpc_test/framework/common/test_constants.py index 3126d0d82c..3126d0d82c 100644 --- a/src/python/src/grpc/framework/common/test_constants.py +++ b/src/python/grpcio_test/grpc_test/framework/common/test_constants.py diff --git a/src/python/src/grpc/framework/common/test_control.py b/src/python/grpcio_test/grpc_test/framework/common/test_control.py index 3960c4e649..3960c4e649 100644 --- a/src/python/src/grpc/framework/common/test_control.py +++ b/src/python/grpcio_test/grpc_test/framework/common/test_control.py diff --git a/src/python/src/grpc/framework/common/test_coverage.py b/src/python/grpcio_test/grpc_test/framework/common/test_coverage.py index a7ed3582c4..a7ed3582c4 100644 --- a/src/python/src/grpc/framework/common/test_coverage.py +++ b/src/python/grpcio_test/grpc_test/framework/common/test_coverage.py diff --git a/src/python/grpcio_test/grpc_test/framework/face/__init__.py b/src/python/grpcio_test/grpc_test/framework/face/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/framework/face/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/src/grpc/framework/face/_test_case.py b/src/python/grpcio_test/grpc_test/framework/face/_test_case.py index 642d500628..486b6e630e 100644 --- a/src/python/src/grpc/framework/face/_test_case.py +++ b/src/python/grpcio_test/grpc_test/framework/face/_test_case.py @@ -30,9 +30,9 @@ """Common lifecycle code for in-memory-ticket-exchange Face-layer tests.""" from grpc.framework.face import implementations -from grpc.framework.face.testing import base_util -from grpc.framework.face.testing import test_case from grpc.framework.foundation import logging_pool +from grpc_test.framework.face.testing import base_util +from grpc_test.framework.face.testing import test_case _TIMEOUT = 3 _MAXIMUM_POOL_SIZE = 10 diff --git a/src/python/src/grpc/framework/face/blocking_invocation_inline_service_test.py b/src/python/grpcio_test/grpc_test/framework/face/blocking_invocation_inline_service_test.py index 763f0f0edc..8674666418 100644 --- a/src/python/src/grpc/framework/face/blocking_invocation_inline_service_test.py +++ b/src/python/grpcio_test/grpc_test/framework/face/blocking_invocation_inline_service_test.py @@ -31,8 +31,8 @@ import unittest -from grpc.framework.face import _test_case -from grpc.framework.face.testing import blocking_invocation_inline_service_test_case as test_case +from grpc_test.framework.face import _test_case +from grpc_test.framework.face.testing import blocking_invocation_inline_service_test_case as test_case class BlockingInvocationInlineServiceTest( diff --git a/src/python/src/grpc/framework/face/event_invocation_synchronous_event_service_test.py b/src/python/grpcio_test/grpc_test/framework/face/event_invocation_synchronous_event_service_test.py index e1ab3cf711..dca373ef7c 100644 --- a/src/python/src/grpc/framework/face/event_invocation_synchronous_event_service_test.py +++ b/src/python/grpcio_test/grpc_test/framework/face/event_invocation_synchronous_event_service_test.py @@ -31,8 +31,8 @@ import unittest -from grpc.framework.face import _test_case -from grpc.framework.face.testing import event_invocation_synchronous_event_service_test_case as test_case +from grpc_test.framework.face import _test_case +from grpc_test.framework.face.testing import event_invocation_synchronous_event_service_test_case as test_case class EventInvocationSynchronousEventServiceTest( diff --git a/src/python/src/grpc/framework/face/future_invocation_asynchronous_event_service_test.py b/src/python/grpcio_test/grpc_test/framework/face/future_invocation_asynchronous_event_service_test.py index 2d13bb911d..99fdf18123 100644 --- a/src/python/src/grpc/framework/face/future_invocation_asynchronous_event_service_test.py +++ b/src/python/grpcio_test/grpc_test/framework/face/future_invocation_asynchronous_event_service_test.py @@ -31,8 +31,8 @@ import unittest -from grpc.framework.face import _test_case -from grpc.framework.face.testing import future_invocation_asynchronous_event_service_test_case as test_case +from grpc_test.framework.face import _test_case +from grpc_test.framework.face.testing import future_invocation_asynchronous_event_service_test_case as test_case class FutureInvocationAsynchronousEventServiceTest( diff --git a/src/python/grpcio_test/grpc_test/framework/face/testing/__init__.py b/src/python/grpcio_test/grpc_test/framework/face/testing/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/src/grpc/framework/face/testing/base_util.py b/src/python/grpcio_test/grpc_test/framework/face/testing/base_util.py index 1df1529b27..1df1529b27 100644 --- a/src/python/src/grpc/framework/face/testing/base_util.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/base_util.py diff --git a/src/python/src/grpc/framework/face/testing/blocking_invocation_inline_service_test_case.py b/src/python/grpcio_test/grpc_test/framework/face/testing/blocking_invocation_inline_service_test_case.py index e57ee00104..7e1158f96b 100644 --- a/src/python/src/grpc/framework/face/testing/blocking_invocation_inline_service_test_case.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/blocking_invocation_inline_service_test_case.py @@ -34,11 +34,11 @@ import abc import unittest # pylint: disable=unused-import from grpc.framework.face import exceptions -from grpc.framework.face.testing import control -from grpc.framework.face.testing import coverage -from grpc.framework.face.testing import digest -from grpc.framework.face.testing import stock_service -from grpc.framework.face.testing import test_case +from grpc_test.framework.face.testing import control +from grpc_test.framework.face.testing import coverage +from grpc_test.framework.face.testing import digest +from grpc_test.framework.face.testing import stock_service +from grpc_test.framework.face.testing import test_case _TIMEOUT = 3 _LONG_TIMEOUT = 45 diff --git a/src/python/src/grpc/framework/face/testing/callback.py b/src/python/grpcio_test/grpc_test/framework/face/testing/callback.py index d0e63c8c56..d0e63c8c56 100644 --- a/src/python/src/grpc/framework/face/testing/callback.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/callback.py diff --git a/src/python/src/grpc/framework/face/testing/control.py b/src/python/grpcio_test/grpc_test/framework/face/testing/control.py index 3960c4e649..3960c4e649 100644 --- a/src/python/src/grpc/framework/face/testing/control.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/control.py diff --git a/src/python/src/grpc/framework/face/testing/coverage.py b/src/python/grpcio_test/grpc_test/framework/face/testing/coverage.py index f3aca113fe..f3aca113fe 100644 --- a/src/python/src/grpc/framework/face/testing/coverage.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/coverage.py diff --git a/src/python/src/grpc/framework/face/testing/digest.py b/src/python/grpcio_test/grpc_test/framework/face/testing/digest.py index db8fcbb018..54ff21779a 100644 --- a/src/python/src/grpc/framework/face/testing/digest.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/digest.py @@ -38,11 +38,11 @@ from grpc.framework.common import cardinality from grpc.framework.common import style from grpc.framework.face import exceptions from grpc.framework.face import interfaces as face_interfaces -from grpc.framework.face.testing import control as testing_control # pylint: disable=unused-import -from grpc.framework.face.testing import interfaces # pylint: disable=unused-import -from grpc.framework.face.testing import service as testing_service # pylint: disable=unused-import from grpc.framework.foundation import stream from grpc.framework.foundation import stream_util +from grpc_test.framework.face.testing import control as testing_control # pylint: disable=unused-import +from grpc_test.framework.face.testing import interfaces # pylint: disable=unused-import +from grpc_test.framework.face.testing import service as testing_service # pylint: disable=unused-import _IDENTITY = lambda x: x diff --git a/src/python/src/grpc/framework/face/testing/event_invocation_synchronous_event_service_test_case.py b/src/python/grpcio_test/grpc_test/framework/face/testing/event_invocation_synchronous_event_service_test_case.py index 0f0b0e3d52..18eed53d6e 100644 --- a/src/python/src/grpc/framework/face/testing/event_invocation_synchronous_event_service_test_case.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/event_invocation_synchronous_event_service_test_case.py @@ -33,12 +33,12 @@ import abc import unittest from grpc.framework.face import interfaces -from grpc.framework.face.testing import callback as testing_callback -from grpc.framework.face.testing import control -from grpc.framework.face.testing import coverage -from grpc.framework.face.testing import digest -from grpc.framework.face.testing import stock_service -from grpc.framework.face.testing import test_case +from grpc_test.framework.face.testing import callback as testing_callback +from grpc_test.framework.face.testing import control +from grpc_test.framework.face.testing import coverage +from grpc_test.framework.face.testing import digest +from grpc_test.framework.face.testing import stock_service +from grpc_test.framework.face.testing import test_case _TIMEOUT = 3 diff --git a/src/python/src/grpc/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py b/src/python/grpcio_test/grpc_test/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py index 21bf9a4248..3b42914342 100644 --- a/src/python/src/grpc/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py @@ -35,13 +35,13 @@ import threading import unittest from grpc.framework.face import exceptions -from grpc.framework.face.testing import control -from grpc.framework.face.testing import coverage -from grpc.framework.face.testing import digest -from grpc.framework.face.testing import stock_service -from grpc.framework.face.testing import test_case from grpc.framework.foundation import future from grpc.framework.foundation import logging_pool +from grpc_test.framework.face.testing import control +from grpc_test.framework.face.testing import coverage +from grpc_test.framework.face.testing import digest +from grpc_test.framework.face.testing import stock_service +from grpc_test.framework.face.testing import test_case _TIMEOUT = 3 _MAXIMUM_POOL_SIZE = 10 diff --git a/src/python/src/grpc/framework/face/testing/interfaces.py b/src/python/grpcio_test/grpc_test/framework/face/testing/interfaces.py index 5932dabf1e..5932dabf1e 100644 --- a/src/python/src/grpc/framework/face/testing/interfaces.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/interfaces.py diff --git a/src/python/src/grpc/framework/face/testing/serial.py b/src/python/grpcio_test/grpc_test/framework/face/testing/serial.py index 47fc5822de..47fc5822de 100644 --- a/src/python/src/grpc/framework/face/testing/serial.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/serial.py diff --git a/src/python/src/grpc/framework/face/testing/service.py b/src/python/grpcio_test/grpc_test/framework/face/testing/service.py index bf54d41d66..ee9d6a3da3 100644 --- a/src/python/src/grpc/framework/face/testing/service.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/service.py @@ -33,7 +33,7 @@ import abc # interfaces is referenced from specification in this module. from grpc.framework.face import interfaces as face_interfaces # pylint: disable=unused-import -from grpc.framework.face.testing import interfaces +from grpc_test.framework.face.testing import interfaces class UnaryUnaryTestMethodImplementation(interfaces.Method): diff --git a/src/python/src/grpc/framework/face/testing/stock_service.py b/src/python/grpcio_test/grpc_test/framework/face/testing/stock_service.py index 61aaf444a0..0f83ca4db1 100644 --- a/src/python/src/grpc/framework/face/testing/stock_service.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/stock_service.py @@ -30,11 +30,11 @@ """Examples of Python implementations of the stock.proto Stock service.""" from grpc.framework.common import cardinality -from grpc.framework.face.testing import service from grpc.framework.foundation import abandonment from grpc.framework.foundation import stream from grpc.framework.foundation import stream_util -from grpc._junkdrawer import stock_pb2 +from grpc_test.framework.face.testing import service +from grpc_test._junkdrawer import stock_pb2 SYMBOL_FORMAT = 'test symbol:%03d' STREAM_LENGTH = 400 diff --git a/src/python/src/grpc/framework/face/testing/test_case.py b/src/python/grpcio_test/grpc_test/framework/face/testing/test_case.py index e60e3d1d40..858d5cf7fd 100644 --- a/src/python/src/grpc/framework/face/testing/test_case.py +++ b/src/python/grpcio_test/grpc_test/framework/face/testing/test_case.py @@ -33,7 +33,7 @@ import abc # face_interfaces and interfaces are referenced in specification in this module. from grpc.framework.face import interfaces as face_interfaces # pylint: disable=unused-import -from grpc.framework.face.testing import interfaces # pylint: disable=unused-import +from grpc_test.framework.face.testing import interfaces # pylint: disable=unused-import class FaceTestCase(object): diff --git a/src/python/grpcio_test/grpc_test/framework/foundation/__init__.py b/src/python/grpcio_test/grpc_test/framework/foundation/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/framework/foundation/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/src/grpc/framework/foundation/_later_test.py b/src/python/grpcio_test/grpc_test/framework/foundation/_later_test.py index 6c2459e185..6c2459e185 100644 --- a/src/python/src/grpc/framework/foundation/_later_test.py +++ b/src/python/grpcio_test/grpc_test/framework/foundation/_later_test.py diff --git a/src/python/src/grpc/framework/foundation/_logging_pool_test.py b/src/python/grpcio_test/grpc_test/framework/foundation/_logging_pool_test.py index 452802da6a..452802da6a 100644 --- a/src/python/src/grpc/framework/foundation/_logging_pool_test.py +++ b/src/python/grpcio_test/grpc_test/framework/foundation/_logging_pool_test.py diff --git a/src/python/src/grpc/framework/foundation/stream_testing.py b/src/python/grpcio_test/grpc_test/framework/foundation/stream_testing.py index 098a53d5e7..098a53d5e7 100644 --- a/src/python/src/grpc/framework/foundation/stream_testing.py +++ b/src/python/grpcio_test/grpc_test/framework/foundation/stream_testing.py diff --git a/src/python/grpcio_test/grpc_test/framework/interfaces/__init__.py b/src/python/grpcio_test/grpc_test/framework/interfaces/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/framework/interfaces/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/grpcio_test/grpc_test/framework/interfaces/links/__init__.py b/src/python/grpcio_test/grpc_test/framework/interfaces/links/__init__.py new file mode 100644 index 0000000000..7086519106 --- /dev/null +++ b/src/python/grpcio_test/grpc_test/framework/interfaces/links/__init__.py @@ -0,0 +1,30 @@ +# 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. + + diff --git a/src/python/src/grpc/framework/interfaces/links/test_cases.py b/src/python/grpcio_test/grpc_test/framework/interfaces/links/test_cases.py index bf1f09d99d..26ca035c44 100644 --- a/src/python/src/grpc/framework/interfaces/links/test_cases.py +++ b/src/python/grpcio_test/grpc_test/framework/interfaces/links/test_cases.py @@ -33,9 +33,9 @@ import abc import unittest # pylint: disable=unused-import -from grpc.framework.common import test_constants from grpc.framework.interfaces.links import links -from grpc.framework.interfaces.links import test_utilities +from grpc_test.framework.common import test_constants +from grpc_test.framework.interfaces.links import test_utilities def at_least_n_payloads_received_predicate(n): diff --git a/src/python/src/grpc/framework/interfaces/links/test_utilities.py b/src/python/grpcio_test/grpc_test/framework/interfaces/links/test_utilities.py index 6c2e3346aa..6c2e3346aa 100644 --- a/src/python/src/grpc/framework/interfaces/links/test_utilities.py +++ b/src/python/grpcio_test/grpc_test/framework/interfaces/links/test_utilities.py diff --git a/src/python/grpcio_test/requirements.txt b/src/python/grpcio_test/requirements.txt new file mode 100644 index 0000000000..856198def5 --- /dev/null +++ b/src/python/grpcio_test/requirements.txt @@ -0,0 +1,5 @@ +pytest>=2.6 +pytest-cov>=2.0 +pytest-xdist>=1.11 +oauth2client>=1.4.7 +grpcio>=0.10.0a0 diff --git a/src/python/grpcio_test/setup.cfg b/src/python/grpcio_test/setup.cfg new file mode 100644 index 0000000000..b32d3f5972 --- /dev/null +++ b/src/python/grpcio_test/setup.cfg @@ -0,0 +1,3 @@ +[pytest] +norecursedirs = _cython +python_files = *_test.py diff --git a/src/python/grpcio_test/setup.py b/src/python/grpcio_test/setup.py new file mode 100644 index 0000000000..925c32720f --- /dev/null +++ b/src/python/grpcio_test/setup.py @@ -0,0 +1,79 @@ +# 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. + +"""A setup module for the GRPC Python interop testing package.""" + +import os +import os.path + +import setuptools + +# Ensure we're in the proper directory whether or not we're being used by pip. +os.chdir(os.path.dirname(os.path.abspath(__file__))) + +# Break import-style to ensure we can actually find our commands module. +import commands + +_PACKAGES = setuptools.find_packages('.', exclude=['*._cython', '*._cython.*']) + +_PACKAGE_DIRECTORIES = { + '': '.', +} + +_PACKAGE_DATA = { + 'grpc_interop': [ + 'credentials/ca.pem', 'credentials/server1.key', + 'credentials/server1.pem',] +} + +_SETUP_REQUIRES = ( + 'pytest>=2.6', + 'pytest-cov>=2.0', + 'pytest-xdist>=1.11', +) + +_INSTALL_REQUIRES = ( + 'oauth2client>=1.4.7', + 'grpcio>=0.10.0a0', +) + +_COMMAND_CLASS = { + 'test': commands.RunTests +} + +setuptools.setup( + name='grpcio_test', + version='0.10.0a0', + packages=_PACKAGES, + package_dir=_PACKAGE_DIRECTORIES, + package_data=_PACKAGE_DATA, + install_requires=_INSTALL_REQUIRES + _SETUP_REQUIRES, + setup_requires=_SETUP_REQUIRES, + cmdclass=_COMMAND_CLASS +) |