aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python
diff options
context:
space:
mode:
Diffstat (limited to 'src/python')
-rw-r--r--src/python/grpcio/grpc/BUILD.bazel82
-rw-r--r--src/python/grpcio/grpc/_cython/BUILD.bazel46
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi16
-rw-r--r--src/python/grpcio/grpc/beta/BUILD.bazel58
-rw-r--r--src/python/grpcio/grpc/experimental/BUILD.bazel27
-rw-r--r--src/python/grpcio/grpc/framework/BUILD.bazel11
-rw-r--r--src/python/grpcio/grpc/framework/common/BUILD.bazel27
-rw-r--r--src/python/grpcio/grpc/framework/foundation/BUILD.bazel61
-rw-r--r--src/python/grpcio/grpc/framework/interfaces/BUILD.bazel10
-rw-r--r--src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel29
-rw-r--r--src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel32
-rw-r--r--src/python/grpcio/grpc_core_dependencies.py2
-rw-r--r--src/python/grpcio_health_checking/setup.py2
-rw-r--r--src/python/grpcio_reflection/setup.py2
-rw-r--r--src/python/grpcio_testing/setup.py2
-rw-r--r--src/python/grpcio_tests/setup.py4
-rw-r--r--src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel17
17 files changed, 419 insertions, 9 deletions
diff --git a/src/python/grpcio/grpc/BUILD.bazel b/src/python/grpcio/grpc/BUILD.bazel
new file mode 100644
index 0000000000..3f214bf3b0
--- /dev/null
+++ b/src/python/grpcio/grpc/BUILD.bazel
@@ -0,0 +1,82 @@
+load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+
+package(default_visibility = ["//visibility:public"])
+
+py_binary(
+ name = "grpcio",
+ srcs = ["__init__.py"],
+ deps = [
+ ":utilities",
+ ":auth",
+ ":plugin_wrapping",
+ ":channel",
+ ":interceptor",
+ ":server",
+ "//src/python/grpcio/grpc/_cython:cygrpc",
+ "//src/python/grpcio/grpc/beta",
+ "//src/python/grpcio/grpc/experimental",
+ "//src/python/grpcio/grpc/framework",
+ requirement('enum34'),
+ requirement('six'),
+ ],
+ data = [
+ "//:grpc",
+ ],
+ main = "__init__.py",
+ imports = ["../",],
+)
+
+py_library(
+ name = "auth",
+ srcs = ["_auth.py"],
+)
+
+py_library(
+ name = "channel",
+ srcs = ["_channel.py"],
+ deps = [
+ ":common",
+ ":grpcio_metadata",
+ ],
+)
+
+py_library(
+ name = "common",
+ srcs = ["_common.py"],
+)
+
+py_library(
+ name = "grpcio_metadata",
+ srcs = ["_grpcio_metadata.py"],
+)
+
+py_library(
+ name = "interceptor",
+ srcs = ["_interceptor.py"],
+)
+
+py_library(
+ name = "plugin_wrapping",
+ srcs = ["_plugin_wrapping.py"],
+ deps = [
+ ":common",
+ ]
+)
+
+py_library(
+ name = "server",
+ srcs = ["_server.py"],
+ deps = [
+ ":common",
+ ":interceptor",
+ ],
+)
+
+py_library(
+ name = "utilities",
+ srcs = ["_utilities.py"],
+ deps = [
+ ":common",
+ ],
+)
+
diff --git a/src/python/grpcio/grpc/_cython/BUILD.bazel b/src/python/grpcio/grpc/_cython/BUILD.bazel
new file mode 100644
index 0000000000..7124e83dee
--- /dev/null
+++ b/src/python/grpcio/grpc/_cython/BUILD.bazel
@@ -0,0 +1,46 @@
+package(default_visibility = ["//visibility:public"])
+
+load("//bazel:cython_library.bzl", "pyx_library")
+
+pyx_library(
+ name = "cygrpc",
+ srcs = [
+ "__init__.py",
+ "cygrpc.pxd",
+ "cygrpc.pyx",
+ "_cygrpc/grpc_string.pyx.pxi",
+ "_cygrpc/arguments.pyx.pxi",
+ "_cygrpc/call.pyx.pxi",
+ "_cygrpc/channel.pyx.pxi",
+ "_cygrpc/credentials.pyx.pxi",
+ "_cygrpc/completion_queue.pyx.pxi",
+ "_cygrpc/event.pyx.pxi",
+ "_cygrpc/metadata.pyx.pxi",
+ "_cygrpc/operation.pyx.pxi",
+ "_cygrpc/records.pyx.pxi",
+ "_cygrpc/security.pyx.pxi",
+ "_cygrpc/server.pyx.pxi",
+ "_cygrpc/tag.pyx.pxi",
+ "_cygrpc/time.pyx.pxi",
+ "_cygrpc/grpc_gevent.pyx.pxi",
+ "_cygrpc/grpc.pxi",
+ "_cygrpc/arguments.pxd.pxi",
+ "_cygrpc/call.pxd.pxi",
+ "_cygrpc/channel.pxd.pxi",
+ "_cygrpc/credentials.pxd.pxi",
+ "_cygrpc/completion_queue.pxd.pxi",
+ "_cygrpc/event.pxd.pxi",
+ "_cygrpc/metadata.pxd.pxi",
+ "_cygrpc/operation.pxd.pxi",
+ "_cygrpc/records.pxd.pxi",
+ "_cygrpc/security.pxd.pxi",
+ "_cygrpc/server.pxd.pxi",
+ "_cygrpc/tag.pxd.pxi",
+ "_cygrpc/time.pxd.pxi",
+ "_cygrpc/grpc_gevent.pxd.pxi",
+ ],
+ deps = [
+ "//:grpc",
+ ],
+)
+
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
index 893df8eac6..aa187e88a6 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
@@ -309,13 +309,18 @@ cdef SegregatedCall _segregated_call(
_ChannelState state, int flags, method, host, object deadline,
object metadata, CallCredentials credentials, operationses_and_user_tags):
cdef _CallState call_state = _CallState()
- cdef grpc_completion_queue *c_completion_queue = (
- grpc_completion_queue_create_for_next(NULL))
cdef SegregatedCall segregated_call
+ cdef grpc_completion_queue *c_completion_queue
def on_success(started_tags):
state.segregated_call_states.add(call_state)
+ with state.condition:
+ if state.open:
+ c_completion_queue = (grpc_completion_queue_create_for_next(NULL))
+ else:
+ raise ValueError('Cannot invoke RPC on closed channel!')
+
try:
_call(
state, call_state, c_completion_queue, on_success, flags, method, host,
@@ -443,8 +448,11 @@ cdef class Channel:
def check_connectivity_state(self, bint try_to_connect):
with self._state.condition:
- return grpc_channel_check_connectivity_state(
- self._state.c_channel, try_to_connect)
+ if self._state.open:
+ return grpc_channel_check_connectivity_state(
+ self._state.c_channel, try_to_connect)
+ else:
+ raise ValueError('Cannot invoke RPC on closed channel!')
def watch_connectivity_state(
self, grpc_connectivity_state last_observed_state, object deadline):
diff --git a/src/python/grpcio/grpc/beta/BUILD.bazel b/src/python/grpcio/grpc/beta/BUILD.bazel
new file mode 100644
index 0000000000..731be5cb25
--- /dev/null
+++ b/src/python/grpcio/grpc/beta/BUILD.bazel
@@ -0,0 +1,58 @@
+load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "beta",
+ srcs = ["__init__.py",],
+ deps = [
+ ":client_adaptations",
+ ":metadata",
+ ":server_adaptations",
+ ":implementations",
+ ":interfaces",
+ ":utilities",
+ ],
+)
+
+py_library(
+ name = "client_adaptations",
+ srcs = ["_client_adaptations.py"],
+ imports=["../../",]
+)
+
+py_library(
+ name = "metadata",
+ srcs = ["_metadata.py"],
+)
+
+py_library(
+ name = "server_adaptations",
+ srcs = ["_server_adaptations.py"],
+ imports=["../../",],
+)
+
+py_library(
+ name = "implementations",
+ srcs = ["implementations.py"],
+ imports=["../../",],
+)
+
+py_library(
+ name = "interfaces",
+ srcs = ["interfaces.py"],
+ deps = [
+ requirement("six"),
+ ],
+ imports=["../../",],
+)
+
+py_library(
+ name = "utilities",
+ srcs = ["utilities.py"],
+ deps = [
+ ":implementations",
+ ":interfaces",
+ "//src/python/grpcio/grpc/framework/foundation",
+ ],
+)
+
diff --git a/src/python/grpcio/grpc/experimental/BUILD.bazel b/src/python/grpcio/grpc/experimental/BUILD.bazel
new file mode 100644
index 0000000000..6598d02747
--- /dev/null
+++ b/src/python/grpcio/grpc/experimental/BUILD.bazel
@@ -0,0 +1,27 @@
+load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "experimental",
+ srcs = ["__init__.py",],
+ deps = [
+ ":gevent",
+ ":session_cache",
+ ],
+)
+
+py_library(
+ name = "gevent",
+ srcs = ["gevent.py"],
+ deps = [
+ "//src/python/grpcio/grpc/_cython:cygrpc",
+ ],
+)
+
+py_library(
+ name = "session_cache",
+ srcs = ["session_cache.py"],
+ deps = [
+ "//src/python/grpcio/grpc/_cython:cygrpc",
+ ],
+)
diff --git a/src/python/grpcio/grpc/framework/BUILD.bazel b/src/python/grpcio/grpc/framework/BUILD.bazel
new file mode 100644
index 0000000000..55b4f4d2df
--- /dev/null
+++ b/src/python/grpcio/grpc/framework/BUILD.bazel
@@ -0,0 +1,11 @@
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "framework",
+ srcs = ["__init__.py",],
+ deps = [
+ "//src/python/grpcio/grpc/framework/common",
+ "//src/python/grpcio/grpc/framework/foundation",
+ "//src/python/grpcio/grpc/framework/interfaces",
+ ],
+)
diff --git a/src/python/grpcio/grpc/framework/common/BUILD.bazel b/src/python/grpcio/grpc/framework/common/BUILD.bazel
new file mode 100644
index 0000000000..9d9ef682c9
--- /dev/null
+++ b/src/python/grpcio/grpc/framework/common/BUILD.bazel
@@ -0,0 +1,27 @@
+load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "common",
+ srcs = ["__init__.py",],
+ deps = [
+ ":cardinality",
+ ":style",
+ ],
+)
+
+py_library(
+ name = "cardinality",
+ srcs = ["cardinality.py"],
+ deps = [
+ requirement("enum34"),
+ ],
+)
+
+py_library(
+ name = "style",
+ srcs = ["style.py"],
+ deps = [
+ requirement("enum34"),
+ ],
+)
diff --git a/src/python/grpcio/grpc/framework/foundation/BUILD.bazel b/src/python/grpcio/grpc/framework/foundation/BUILD.bazel
new file mode 100644
index 0000000000..1287fdd44e
--- /dev/null
+++ b/src/python/grpcio/grpc/framework/foundation/BUILD.bazel
@@ -0,0 +1,61 @@
+load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "foundation",
+ srcs = ["__init__.py",],
+ deps = [
+ ":abandonment",
+ ":callable_util",
+ ":future",
+ ":logging_pool",
+ ":stream_util",
+ ":stream",
+ ],
+)
+
+py_library(
+ name = "abandonment",
+ srcs = ["abandonment.py"],
+)
+
+py_library(
+ name = "callable_util",
+ srcs = ["callable_util.py"],
+ deps = [
+ requirement("enum34"),
+ requirement("six"),
+ ],
+)
+
+py_library(
+ name = "future",
+ srcs = ["future.py"],
+ deps = [
+ requirement("six"),
+ ],
+)
+
+py_library(
+ name = "logging_pool",
+ srcs = ["logging_pool.py"],
+ deps = [
+ requirement("futures"),
+ ],
+)
+
+py_library(
+ name = "stream_util",
+ srcs = ["stream_util.py"],
+ deps = [
+ ":stream",
+ ],
+)
+
+py_library(
+ name = "stream",
+ srcs = ["stream.py"],
+ deps = [
+ requirement("six"),
+ ],
+)
diff --git a/src/python/grpcio/grpc/framework/interfaces/BUILD.bazel b/src/python/grpcio/grpc/framework/interfaces/BUILD.bazel
new file mode 100644
index 0000000000..b81e196cc3
--- /dev/null
+++ b/src/python/grpcio/grpc/framework/interfaces/BUILD.bazel
@@ -0,0 +1,10 @@
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "interfaces",
+ srcs = ["__init__.py",],
+ deps = [
+ "//src/python/grpcio/grpc/framework/interfaces/base",
+ "//src/python/grpcio/grpc/framework/interfaces/face",
+ ],
+)
diff --git a/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel b/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel
new file mode 100644
index 0000000000..408a66a631
--- /dev/null
+++ b/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel
@@ -0,0 +1,29 @@
+load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "base_lib",
+ srcs = ["__init__.py",],
+ deps = [
+ ":base",
+ ":utilities",
+ ],
+)
+
+py_library(
+ name = "base",
+ srcs = ["base.py"],
+ deps = [
+ "//src/python/grpcio/grpc/framework/foundation:abandonment",
+ requirement("enum34"),
+ requirement("six"),
+ ],
+)
+
+py_library(
+ name = "utilities",
+ srcs = ["utilities.py"],
+ deps = [
+ requirement("enum34"),
+ ],
+)
diff --git a/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel b/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel
new file mode 100644
index 0000000000..e683e7cc42
--- /dev/null
+++ b/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel
@@ -0,0 +1,32 @@
+load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "face",
+ srcs = ["__init__.py",],
+ deps = [
+ ":face_lib",
+ ":utilities",
+ ],
+)
+
+py_library(
+ name = "face_lib",
+ srcs = ["face.py"],
+ deps = [
+ "//src/python/grpcio/grpc/framework/foundation",
+ "//src/python/grpcio/grpc/framework/common",
+ requirement("enum34"),
+ requirement("six"),
+ ],
+)
+
+py_library(
+ name = "utilities",
+ srcs = ["utilities.py"],
+ deps = [
+ "//src/python/grpcio/grpc/framework/common",
+ "//src/python/grpcio/grpc/framework/foundation:stream",
+ ":face_lib",
+ ],
+)
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index d6efb49750..a8158311fb 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -254,6 +254,8 @@ CORE_SOURCE_FILES = [
'src/core/lib/security/credentials/plugin/plugin_credentials.cc',
'src/core/lib/security/credentials/ssl/ssl_credentials.cc',
'src/core/lib/security/security_connector/alts_security_connector.cc',
+ 'src/core/lib/security/security_connector/load_system_roots_fallback.cc',
+ 'src/core/lib/security/security_connector/load_system_roots_linux.cc',
'src/core/lib/security/security_connector/local_security_connector.cc',
'src/core/lib/security/security_connector/security_connector.cc',
'src/core/lib/security/transport/client_auth_filter.cc',
diff --git a/src/python/grpcio_health_checking/setup.py b/src/python/grpcio_health_checking/setup.py
index 35c09827ba..db2edae2ce 100644
--- a/src/python/grpcio_health_checking/setup.py
+++ b/src/python/grpcio_health_checking/setup.py
@@ -57,7 +57,7 @@ PACKAGE_DIRECTORIES = {
}
INSTALL_REQUIRES = (
- 'protobuf>=3.5.2.post1',
+ 'protobuf>=3.6.0',
'grpcio>={version}'.format(version=grpc_version.VERSION),
)
diff --git a/src/python/grpcio_reflection/setup.py b/src/python/grpcio_reflection/setup.py
index 589d0ff556..b4087d87b4 100644
--- a/src/python/grpcio_reflection/setup.py
+++ b/src/python/grpcio_reflection/setup.py
@@ -58,7 +58,7 @@ PACKAGE_DIRECTORIES = {
}
INSTALL_REQUIRES = (
- 'protobuf>=3.5.2.post1',
+ 'protobuf>=3.6.0',
'grpcio>={version}'.format(version=grpc_version.VERSION),
)
diff --git a/src/python/grpcio_testing/setup.py b/src/python/grpcio_testing/setup.py
index eb480a5464..6ceb1fc5c9 100644
--- a/src/python/grpcio_testing/setup.py
+++ b/src/python/grpcio_testing/setup.py
@@ -29,7 +29,7 @@ PACKAGE_DIRECTORIES = {
}
INSTALL_REQUIRES = (
- 'protobuf>=3.5.2.post1',
+ 'protobuf>=3.6.0',
'grpcio>={version}'.format(version=grpc_version.VERSION),
)
diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py
index 1262e48571..a94c0963ec 100644
--- a/src/python/grpcio_tests/setup.py
+++ b/src/python/grpcio_tests/setup.py
@@ -41,8 +41,8 @@ INSTALL_REQUIRES = (
'grpcio>={version}'.format(version=grpc_version.VERSION),
'grpcio-tools>={version}'.format(version=grpc_version.VERSION),
'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION),
- 'oauth2client>=1.4.7', 'protobuf>=3.5.2.post1', 'six>=1.10',
- 'google-auth>=1.0.0', 'requests>=2.14.2')
+ 'oauth2client>=1.4.7', 'protobuf>=3.6.0', 'six>=1.10', 'google-auth>=1.0.0',
+ 'requests>=2.14.2')
if not PY3:
INSTALL_REQUIRES += ('futures>=2.2.0',)
diff --git a/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel b/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel
new file mode 100644
index 0000000000..d69186e1fd
--- /dev/null
+++ b/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel
@@ -0,0 +1,17 @@
+package(default_visibility = ["//visibility:public"])
+
+py_library(
+ name = "stream_testing",
+ srcs = ["stream_testing.py"],
+)
+
+py_test(
+ name = "logging_pool_test",
+ srcs = ["_logging_pool_test.py"],
+ main = "_logging_pool_test.py",
+ size = "small",
+ deps = [
+ "//src/python/grpcio/grpc:grpcio",
+ ],
+)
+