MErge Master

pull/37775/head
tanvi-jagtap 2 months ago
commit 13b6030ceb
  1. 52
      CMakeLists.txt
  2. 1
      PYTHON-MANIFEST.in
  3. 2
      WORKSPACE
  4. 10
      bazel/BUILD
  5. 93
      bazel/_logging_threshold_test_main.py
  6. 54
      bazel/_single_module_tester.py
  7. 8
      bazel/experiments.bzl
  8. 6
      bazel/grpc_python_deps.bzl
  9. 3
      bazel/internal_python_rules.bzl
  10. 73
      bazel/logging_threshold_test.bzl
  11. 1
      black.toml
  12. 29
      build_autogenerated.yaml
  13. 7
      build_handwritten.yaml
  14. 2
      examples/python/helloworld/helloworld_pb2_grpc.py
  15. 27
      setup.py
  16. 1
      src/core/BUILD
  17. 18
      src/core/lib/experiments/experiments.cc
  18. 8
      src/core/lib/experiments/experiments.h
  19. 5
      src/core/lib/experiments/experiments.yaml
  20. 2
      src/core/lib/experiments/rollouts.yaml
  21. 12
      src/core/lib/security/security_connector/local/local_security_connector.cc
  22. 3
      src/python/grpcio/README.rst
  23. 20
      src/python/grpcio/python_version.py
  24. 1
      src/python/grpcio_admin/MANIFEST.in
  25. 20
      src/python/grpcio_admin/python_version.py
  26. 5
      src/python/grpcio_admin/setup.py
  27. 1
      src/python/grpcio_channelz/MANIFEST.in
  28. 3
      src/python/grpcio_channelz/README.rst
  29. 2
      src/python/grpcio_channelz/grpc_version.py
  30. 20
      src/python/grpcio_channelz/python_version.py
  31. 29
      src/python/grpcio_channelz/setup.py
  32. 1
      src/python/grpcio_csds/MANIFEST.in
  33. 20
      src/python/grpcio_csds/python_version.py
  34. 4
      src/python/grpcio_csds/setup.py
  35. 1
      src/python/grpcio_csm_observability/MANIFEST.in
  36. 3
      src/python/grpcio_csm_observability/README.rst
  37. 20
      src/python/grpcio_csm_observability/python_version.py
  38. 4
      src/python/grpcio_csm_observability/setup.py
  39. 1
      src/python/grpcio_health_checking/MANIFEST.in
  40. 3
      src/python/grpcio_health_checking/README.rst
  41. 20
      src/python/grpcio_health_checking/python_version.py
  42. 27
      src/python/grpcio_health_checking/setup.py
  43. 1
      src/python/grpcio_observability/MANIFEST.in
  44. 3
      src/python/grpcio_observability/README.rst
  45. 20
      src/python/grpcio_observability/python_version.py
  46. 3
      src/python/grpcio_observability/setup.py
  47. 1
      src/python/grpcio_reflection/MANIFEST.in
  48. 3
      src/python/grpcio_reflection/README.rst
  49. 20
      src/python/grpcio_reflection/python_version.py
  50. 27
      src/python/grpcio_reflection/setup.py
  51. 1
      src/python/grpcio_status/MANIFEST.in
  52. 3
      src/python/grpcio_status/README.rst
  53. 20
      src/python/grpcio_status/python_version.py
  54. 27
      src/python/grpcio_status/setup.py
  55. 3
      src/python/grpcio_testing/README.rst
  56. 31
      src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py
  57. 8
      src/python/grpcio_tests/tests/unit/_signal_handling_test.py
  58. 22
      templates/src/python/grpcio/python_version.py.template
  59. 22
      templates/src/python/grpcio_admin/python_version.py.template
  60. 2
      templates/src/python/grpcio_channelz/grpc_version.py.template
  61. 22
      templates/src/python/grpcio_channelz/python_version.py.template
  62. 22
      templates/src/python/grpcio_csds/python_version.py.template
  63. 22
      templates/src/python/grpcio_csm_observability/python_version.py.template
  64. 22
      templates/src/python/grpcio_health_checking/python_version.py.template
  65. 22
      templates/src/python/grpcio_observability/python_version.py.template
  66. 22
      templates/src/python/grpcio_reflection/python_version.py.template
  67. 22
      templates/src/python/grpcio_status/python_version.py.template
  68. 2
      templates/tools/distrib/python/grpc_version.py.template
  69. 22
      templates/tools/distrib/python/grpcio_tools/grpc_tools/python_version.py.template
  70. 22
      templates/tools/distrib/python/grpcio_tools/python_version.py.template
  71. 2
      templates/tools/distrib/python/xds_protos/grpc_version.py.template
  72. 22
      templates/tools/distrib/python/xds_protos/python_version.py.template
  73. 14
      templates/tools/dockerfile/ccache_crosscompile.include
  74. 21
      templates/tools/dockerfile/compile_python_313.include
  75. 22
      templates/tools/dockerfile/git_config.include
  76. 57
      templates/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile.template
  77. 28
      templates/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile.template
  78. 33
      templates/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile.template
  79. 34
      templates/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile.template
  80. 27
      templates/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile.template
  81. 25
      templates/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile.template
  82. 8
      templates/tools/dockerfile/python_pip_builds.include
  83. 1
      templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template
  84. 7
      test/core/end2end/end2end_test_suites.cc
  85. 6
      test/core/end2end/end2end_tests.h
  86. 6
      test/core/end2end/tests/call_creds.cc
  87. 2
      test/core/end2end/tests/no_logging.cc
  88. 17
      test/core/security/BUILD
  89. 147
      test/core/security/local_security_connector_test.cc
  90. 2
      test/distrib/bazel/python/WORKSPACE
  91. 14
      tools/bazelify_tests/dockerimage_current_versions.bzl
  92. 8
      tools/bazelify_tests/test/BUILD
  93. 4
      tools/bazelify_tests/test/build_artifact_python_linux_x64_cp313.sh
  94. 33
      tools/buildgen/plugins/expand_supported_python_versions.py
  95. 72
      tools/distrib/install_all_python_modules.sh
  96. 25
      tools/distrib/install_python_modules_and_run_tests.sh
  97. 2
      tools/distrib/python/grpc_version.py
  98. 2
      tools/distrib/python/grpcio_tools/MANIFEST.in
  99. 20
      tools/distrib/python/grpcio_tools/grpc_tools/python_version.py
  100. 20
      tools/distrib/python/grpcio_tools/python_version.py
  101. Some files were not shown because too many files have changed in this diff Show More

52
CMakeLists.txt generated

@ -1220,6 +1220,7 @@ if(gRPC_BUILD_TESTS)
endif()
add_dependencies(buildtests_cxx load_config_test)
add_dependencies(buildtests_cxx load_file_test)
add_dependencies(buildtests_cxx local_security_connector_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx log_too_many_open_files_test)
endif()
@ -19669,6 +19670,57 @@ target_link_libraries(load_file_test
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(local_security_connector_test
test/core/security/local_security_connector_test.cc
test/core/test_util/cmdline.cc
test/core/test_util/fuzzer_util.cc
test/core/test_util/grpc_profiler.cc
test/core/test_util/histogram.cc
test/core/test_util/mock_endpoint.cc
test/core/test_util/parse_hexstring.cc
test/core/test_util/resolve_localhost_ip46.cc
test/core/test_util/slice_splitter.cc
test/core/test_util/tracer_util.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(local_security_connector_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(local_security_connector_test PUBLIC cxx_std_14)
target_include_directories(local_security_connector_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(local_security_connector_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
grpc_test_util
)
endif()
if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)

@ -17,6 +17,7 @@ include src/python/grpcio/_parallel_compile_patch.py
include src/python/grpcio/_spawn_patch.py
include src/python/grpcio/commands.py
include src/python/grpcio/grpc_version.py
include src/python/grpcio/python_version.py
include src/python/grpcio/grpc_core_dependencies.py
include src/python/grpcio/precompiled.py
include src/python/grpcio/support.py

@ -89,7 +89,7 @@ load("@com_google_protobuf//bazel:system_python.bzl", "system_python")
system_python(
name = "system_python",
minimum_python_version = "3.7",
minimum_python_version = "3.8",
)
load("@system_python//:pip.bzl", system_pip_parse = "pip_parse")

@ -20,7 +20,17 @@ licenses(["notice"])
package(default_visibility = ["//:__subpackages__"])
filegroup(
name = "_single_module_tester",
srcs = ["_single_module_tester.py"],
)
filegroup(
name = "_gevent_test_main",
srcs = ["_gevent_test_main.py"],
)
filegroup(
name = "_logging_threshold_test_main",
srcs = ["_logging_threshold_test_main.py"],
)

@ -0,0 +1,93 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import re
import subprocess
import sys
import tempfile
_OK_TEST_REGEX = r"^-+.*Ran ([\d]+) tests* in ([\d.]+)s.*OK(?: \(skipped=(\d+)\))?\n$"
# Tests with known exception logs.
# TODO(sourabhsinghs): Investigate and enable _rpc_part_1_test and _rpc_part_2_test tests.
_SKIP_TESTS = [
"_rpc_part_1_test",
"_server_shutdown_test",
"_xds_credentials_test",
"_server_test",
"_invalid_metadata_test",
"_reconnect_test",
"_channel_close_test",
"_rpc_part_2_test",
"_invocation_defects_test",
"_dynamic_stubs_test",
"_channel_connectivity_test",
]
if __name__ == "__main__":
if len(sys.argv) != 3:
print(f"USAGE: {sys.argv[0]} TARGET_MODULE", file=sys.stderr)
sys.exit(1)
test_script = sys.argv[1]
target_module = sys.argv[2]
if target_module in _SKIP_TESTS:
print(f"Skipping {target_module}")
sys.exit(0)
command = [
sys.executable,
os.path.realpath(test_script),
target_module,
os.path.dirname(os.path.relpath(__file__)),
]
with tempfile.TemporaryFile(mode="w+") as stdout_file:
with tempfile.TemporaryFile(mode="w+") as stderr_file:
result = subprocess.run(
command,
stdout=stdout_file,
stderr=stderr_file,
text=True,
check=True,
)
stdout_file.seek(0)
stderr_file.seek(0)
stdout_count = len(stdout_file.readlines())
stderr_count = len(stderr_file.readlines())
if result.returncode != 0:
sys.exit("Test failure")
stderr_file.seek(0)
if not re.fullmatch(_OK_TEST_REGEX, stderr_file.read(), re.DOTALL):
print(
f"Warning: Excessive error output detected ({stderr_count} lines):"
)
stderr_file.seek(0)
for line in stderr_file:
print(line)
if stdout_count > 0:
print(
f"Warning: Unexpected output detected ({stdout_count} lines):"
)
stdout_file.seek(0)
for line in stdout_file:
print(line)

@ -0,0 +1,54 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Sequence, Optional
import unittest
import sys
import pkgutil
class SingleLoader(object):
def __init__(self, pattern: str, unittest_path: str):
loader = unittest.TestLoader()
self.suite = unittest.TestSuite()
tests = []
for importer, module_name, is_package in pkgutil.walk_packages([unittest_path]):
if pattern in module_name:
module = importer.find_module(module_name).load_module(module_name)
tests.append(loader.loadTestsFromModule(module))
if len(tests) != 1:
raise AssertionError("Expected only 1 test module. Found {}".format(tests))
self.suite.addTest(tests[0])
def loadTestsFromNames(self, names: Sequence[str], module: Optional[str] = None) -> unittest.TestSuite:
return self.suite
if __name__ == "__main__":
if len(sys.argv) != 3:
print(f"USAGE: {sys.argv[0]} TARGET_MODULE", file=sys.stderr)
sys.exit(1)
target_module = sys.argv[1]
unittest_path = sys.argv[2]
loader = SingleLoader(target_module, unittest_path)
runner = unittest.TextTestRunner(verbosity=0)
result = runner.run(loader.suite)
if not result.wasSuccessful():
sys.exit("Test failure.")

@ -25,6 +25,7 @@ EXPERIMENT_ENABLES = {
"event_engine_dns": "event_engine_dns",
"event_engine_listener": "event_engine_listener",
"free_large_allocator": "free_large_allocator",
"local_connector_secure": "local_connector_secure",
"max_pings_wo_data_throttle": "max_pings_wo_data_throttle",
"monitoring_experiment": "monitoring_experiment",
"multiping": "multiping",
@ -52,6 +53,9 @@ EXPERIMENTS = {
"dbg": {
},
"off": {
"core_end2end_test": [
"local_connector_secure",
],
"endpoint_test": [
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
@ -98,6 +102,9 @@ EXPERIMENTS = {
"dbg": {
},
"off": {
"core_end2end_test": [
"local_connector_secure",
],
"endpoint_test": [
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
@ -130,6 +137,7 @@ EXPERIMENTS = {
"off": {
"core_end2end_test": [
"event_engine_client",
"local_connector_secure",
"work_serializer_dispatch",
],
"cpp_end2end_test": [

@ -38,9 +38,9 @@ def grpc_python_deps():
http_archive(
name = "cython",
build_file = "@com_github_grpc_grpc//third_party:cython.BUILD",
sha256 = "a2da56cc22be823acf49741b9aa3aa116d4f07fa8e8b35a3cb08b8447b37c607",
strip_prefix = "cython-0.29.35",
sha256 = "2ec7d66d23d6da2328fb24f5c1bec6c63a59ec2e91027766ab904f417e1078aa",
strip_prefix = "cython-3.0.11",
urls = [
"https://github.com/cython/cython/archive/0.29.35.tar.gz",
"https://github.com/cython/cython/archive/3.0.11.tar.gz",
],
)

@ -14,6 +14,7 @@
"""Python-related rules intended only for use internal to the repo."""
load("//bazel:gevent_test.bzl", "py_grpc_gevent_test")
load("//bazel:logging_threshold_test.bzl", "py_grpc_logging_threshold_test")
def internal_py_grpc_test(name, **kwargs):
"""Runs a test under all supported environments.
@ -28,6 +29,7 @@ def internal_py_grpc_test(name, **kwargs):
**kwargs
)
py_grpc_gevent_test(name, **kwargs)
py_grpc_logging_threshold_test(name, **kwargs)
suite_kwargs = {}
if "visibility" in kwargs:
@ -38,6 +40,7 @@ def internal_py_grpc_test(name, **kwargs):
tests = [
name + ".native",
name + ".gevent",
name + ".logging_threshold",
],
**suite_kwargs
)

@ -0,0 +1,73 @@
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Houses py_grpc_logging_threshold_test.
"""
_COPIED_MAIN_SUFFIX = ".logging_threshold.main"
def py_grpc_logging_threshold_test(
name,
srcs,
main = None,
deps = None,
data = None,
**kwargs):
"""Runs a Python unit test and checks amount of logging against a threshold.
Args:
name: The name of the test.
srcs: The source files.
main: The main file of the test.
deps: The dependencies of the test.
data: The data dependencies of the test.
**kwargs: Any other test arguments.
"""
if main == None:
if len(srcs) != 1:
fail("When main is not provided, srcs must be of size 1.")
main = srcs[0]
deps = [] if deps == None else deps
data = [] if data == None else data
lib_name = name + ".logging_threshold.lib"
native.py_library(
name = lib_name,
srcs = srcs,
)
augmented_deps = deps + [
":{}".format(lib_name),
]
# The main file needs to be in the same package as the test file.
copied_main_name = name + _COPIED_MAIN_SUFFIX
copied_main_filename = copied_main_name + ".py"
native.genrule(
name = copied_main_name,
srcs = ["//bazel:_logging_threshold_test_main.py"],
outs = [copied_main_filename],
cmd = "cp $< $@",
)
native.py_test(
name = name + ".logging_threshold",
args = ["$(location //bazel:_single_module_tester)", name],
data = data + ["//bazel:_single_module_tester"],
deps = augmented_deps,
srcs = [copied_main_filename],
main = copied_main_filename,
python_version = "PY3",
flaky = False,
**kwargs
)

@ -15,6 +15,7 @@ extend-exclude = '''
| test/cpp/naming/resolver_component_tests_runner.py # AUTO-GENERATED
# AUTO-GENERATED from a template:
| grpc_version.py
| python_version.py
| src/python/grpcio/grpc_core_dependencies.py
| src/python/grpcio/grpc/_grpcio_metadata.py
# AUTO-GENERATED BY make_grpcio_tools.py

@ -12980,6 +12980,35 @@ targets:
- gtest
- grpc_test_util
uses_polling: false
- name: local_security_connector_test
gtest: true
build: test
language: c++
headers:
- test/core/test_util/cmdline.h
- test/core/test_util/evaluate_args_test_util.h
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
- test/core/test_util/slice_splitter.h
- test/core/test_util/tracer_util.h
src:
- test/core/security/local_security_connector_test.cc
- test/core/test_util/cmdline.cc
- test/core/test_util/fuzzer_util.cc
- test/core/test_util/grpc_profiler.cc
- test/core/test_util/histogram.cc
- test/core/test_util/mock_endpoint.cc
- test/core/test_util/parse_hexstring.cc
- test/core/test_util/resolve_localhost_ip46.cc
- test/core/test_util/slice_splitter.cc
- test/core/test_util/tracer_util.cc
deps:
- gtest
- grpc_test_util
- name: log_too_many_open_files_test
gtest: true
build: test

@ -16,6 +16,13 @@ settings:
csharp_major_version: 2
g_stands_for: groovy
protobuf_version: 3.28.1
supported_python_versions:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
version: 1.68.0-dev
configs:
asan:

@ -5,7 +5,7 @@ import warnings
import helloworld_pb2 as helloworld__pb2
GRPC_GENERATED_VERSION = '1.67.0.dev0'
GRPC_GENERATED_VERSION = '1.66.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

@ -88,6 +88,7 @@ sys.path.insert(0, os.path.abspath(PYTHON_STEM))
import _parallel_compile_patch
import _spawn_patch
import grpc_core_dependencies
import python_version
import commands
import grpc_version
@ -95,19 +96,21 @@ import grpc_version
_parallel_compile_patch.monkeypatch_compile_maybe()
_spawn_patch.monkeypatch_spawn()
LICENSE = "Apache License 2.0"
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
]
CLASSIFIERS = (
[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
+ [
f"Programming Language :: Python :: {x}"
for x in python_version.SUPPORTED_PYTHON_VERSIONS
]
+ ["License :: OSI Approved :: Apache Software License"]
)
def _env_bool_value(env_name, default):
@ -596,7 +599,7 @@ setuptools.setup(
packages=list(PACKAGES),
package_dir=PACKAGE_DIRECTORIES,
package_data=PACKAGE_DATA,
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRES,
setup_requires=SETUP_REQUIRES,

@ -4099,6 +4099,7 @@ grpc_cc_library(
"channel_args",
"closure",
"error",
"experiments",
"grpc_sockaddr",
"iomgr_fwd",
"resolved_address",

@ -47,6 +47,10 @@ const char* const additional_constraints_event_engine_listener = "{}";
const char* const description_free_large_allocator =
"If set, return all free bytes from a \042big\042 allocator";
const char* const additional_constraints_free_large_allocator = "{}";
const char* const description_local_connector_secure =
"Local security connector uses TSI_SECURITY_NONE for LOCAL_TCP "
"connections.";
const char* const additional_constraints_local_connector_secure = "{}";
const char* const description_max_pings_wo_data_throttle =
"Experiment to throttle pings to a period of 1 min when "
"GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of "
@ -122,6 +126,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_event_engine_listener, nullptr, 0, false, true},
{"free_large_allocator", description_free_large_allocator,
additional_constraints_free_large_allocator, nullptr, 0, false, true},
{"local_connector_secure", description_local_connector_secure,
additional_constraints_local_connector_secure, nullptr, 0, false, true},
{"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle,
additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false,
true},
@ -190,6 +196,10 @@ const char* const additional_constraints_event_engine_listener = "{}";
const char* const description_free_large_allocator =
"If set, return all free bytes from a \042big\042 allocator";
const char* const additional_constraints_free_large_allocator = "{}";
const char* const description_local_connector_secure =
"Local security connector uses TSI_SECURITY_NONE for LOCAL_TCP "
"connections.";
const char* const additional_constraints_local_connector_secure = "{}";
const char* const description_max_pings_wo_data_throttle =
"Experiment to throttle pings to a period of 1 min when "
"GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of "
@ -265,6 +275,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_event_engine_listener, nullptr, 0, true, true},
{"free_large_allocator", description_free_large_allocator,
additional_constraints_free_large_allocator, nullptr, 0, false, true},
{"local_connector_secure", description_local_connector_secure,
additional_constraints_local_connector_secure, nullptr, 0, false, true},
{"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle,
additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false,
true},
@ -333,6 +345,10 @@ const char* const additional_constraints_event_engine_listener = "{}";
const char* const description_free_large_allocator =
"If set, return all free bytes from a \042big\042 allocator";
const char* const additional_constraints_free_large_allocator = "{}";
const char* const description_local_connector_secure =
"Local security connector uses TSI_SECURITY_NONE for LOCAL_TCP "
"connections.";
const char* const additional_constraints_local_connector_secure = "{}";
const char* const description_max_pings_wo_data_throttle =
"Experiment to throttle pings to a period of 1 min when "
"GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of "
@ -408,6 +424,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_event_engine_listener, nullptr, 0, true, true},
{"free_large_allocator", description_free_large_allocator,
additional_constraints_free_large_allocator, nullptr, 0, false, true},
{"local_connector_secure", description_local_connector_secure,
additional_constraints_local_connector_secure, nullptr, 0, false, true},
{"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle,
additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false,
true},

@ -67,6 +67,7 @@ inline bool IsEventEngineClientEnabled() { return false; }
inline bool IsEventEngineDnsEnabled() { return false; }
inline bool IsEventEngineListenerEnabled() { return false; }
inline bool IsFreeLargeAllocatorEnabled() { return false; }
inline bool IsLocalConnectorSecureEnabled() { return false; }
inline bool IsMaxPingsWoDataThrottleEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
inline bool IsMonitoringExperimentEnabled() { return true; }
@ -101,6 +102,7 @@ inline bool IsEventEngineDnsEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER
inline bool IsEventEngineListenerEnabled() { return true; }
inline bool IsFreeLargeAllocatorEnabled() { return false; }
inline bool IsLocalConnectorSecureEnabled() { return false; }
inline bool IsMaxPingsWoDataThrottleEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
inline bool IsMonitoringExperimentEnabled() { return true; }
@ -134,6 +136,7 @@ inline bool IsEventEngineDnsEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER
inline bool IsEventEngineListenerEnabled() { return true; }
inline bool IsFreeLargeAllocatorEnabled() { return false; }
inline bool IsLocalConnectorSecureEnabled() { return false; }
inline bool IsMaxPingsWoDataThrottleEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
inline bool IsMonitoringExperimentEnabled() { return true; }
@ -165,6 +168,7 @@ enum ExperimentIds {
kExperimentIdEventEngineDns,
kExperimentIdEventEngineListener,
kExperimentIdFreeLargeAllocator,
kExperimentIdLocalConnectorSecure,
kExperimentIdMaxPingsWoDataThrottle,
kExperimentIdMonitoringExperiment,
kExperimentIdMultiping,
@ -213,6 +217,10 @@ inline bool IsEventEngineListenerEnabled() {
inline bool IsFreeLargeAllocatorEnabled() {
return IsExperimentEnabled<kExperimentIdFreeLargeAllocator>();
}
#define GRPC_EXPERIMENT_IS_INCLUDED_LOCAL_CONNECTOR_SECURE
inline bool IsLocalConnectorSecureEnabled() {
return IsExperimentEnabled<kExperimentIdLocalConnectorSecure>();
}
#define GRPC_EXPERIMENT_IS_INCLUDED_MAX_PINGS_WO_DATA_THROTTLE
inline bool IsMaxPingsWoDataThrottleEnabled() {
return IsExperimentEnabled<kExperimentIdMaxPingsWoDataThrottle>();

@ -88,6 +88,11 @@
expiry: 2024/12/01
owner: alishananda@google.com
test_tags: [resource_quota_test]
- name: local_connector_secure
description: Local security connector uses TSI_SECURITY_NONE for LOCAL_TCP connections.
expiry: 2024/10/30
owner: aermolov@google.com
test_tags: ["core_end2end_test"]
- name: max_pings_wo_data_throttle
description:
Experiment to throttle pings to a period of 1 min when

@ -75,6 +75,8 @@
windows: true
- name: free_large_allocator
default: false
- name: local_connector_secure
default: false
- name: max_pings_wo_data_throttle
default: false
- name: monitoring_experiment

@ -43,6 +43,7 @@
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/error.h"
@ -143,9 +144,14 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
}
if (peer.properties != nullptr) gpr_free(peer.properties);
peer.properties = new_properties;
// TODO(yihuazhang): Set security level of local TCP to TSI_SECURITY_NONE.
const char* security_level =
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY);
// Set security level to PRIVACY_AND_INTEGRITY for UDS, or NONE otherwise.
const char* security_level;
if (grpc_core::IsLocalConnectorSecureEnabled()) {
security_level = tsi_security_level_to_string(
type == UDS ? TSI_PRIVACY_AND_INTEGRITY : TSI_SECURITY_NONE);
} else {
security_level = tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY);
}
tsi_result result = tsi_construct_string_peer_property_from_cstring(
TSI_SECURITY_LEVEL_PEER_PROPERTY, security_level,
&peer.properties[peer.property_count]);

@ -8,9 +8,6 @@ Package for gRPC Python.
.. |compat_check_pypi| image:: https://python-compatibility-tools.appspot.com/one_badge_image?package=grpcio
:target: https://python-compatibility-tools.appspot.com/one_badge_target?package=grpcio
Supported Python Versions
-------------------------
Python >= 3.8
Installation
------------

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -1,4 +1,5 @@
include grpc_version.py
include python_version.py
recursive-include grpc_admin *.py
global-exclude *.pyc
include LICENSE

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -25,6 +25,8 @@ _README_PATH = os.path.join(_PACKAGE_PATH, "README.rst")
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our local modules.
import python_version
import grpc_version
CLASSIFIERS = [
@ -44,6 +46,7 @@ INSTALL_REQUIRES = (
)
SETUP_REQUIRES = INSTALL_REQUIRES
setuptools.setup(
name="grpcio-admin",
version=grpc_version.VERSION,
@ -56,7 +59,7 @@ setuptools.setup(
url="https://grpc.io",
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages("."),
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
)

@ -1,4 +1,5 @@
include grpc_version.py
include python_version.py
recursive-include grpc_channelz *.py *.pyi
global-exclude *.pyc
include LICENSE

@ -3,9 +3,6 @@ gRPC Python Channelz package
Channelz is a live debug tool in gRPC Python.
Supported Python Versions
-------------------------
Python >= 3.8
Dependencies
------------

@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!!
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/python_version.py.template`!!!
VERSION = '1.68.0.dev0'

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -25,6 +25,8 @@ _README_PATH = os.path.join(_PACKAGE_PATH, "README.rst")
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our local modules.
import python_version
import grpc_version
@ -44,17 +46,19 @@ class _NoOpCommand(setuptools.Command):
pass
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
]
CLASSIFIERS = (
[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
+ [
f"Programming Language :: Python :: {x}"
for x in python_version.SUPPORTED_PYTHON_VERSIONS
]
+ ["License :: OSI Approved :: Apache Software License"]
)
PACKAGE_DIRECTORIES = {
"": ".",
@ -85,6 +89,7 @@ except ImportError:
"build_package_protos": _NoOpCommand,
}
setuptools.setup(
name="grpcio-channelz",
version=grpc_version.VERSION,
@ -97,7 +102,7 @@ setuptools.setup(
url="https://grpc.io",
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages("."),
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS,

@ -1,4 +1,5 @@
include grpc_version.py
include python_version.py
recursive-include grpc_csds *.py
global-exclude *.pyc
include LICENSE

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -25,6 +25,8 @@ _README_PATH = os.path.join(_PACKAGE_PATH, "README.rst")
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our local modules.
import python_version
import grpc_version
CLASSIFIERS = [
@ -57,7 +59,7 @@ setuptools.setup(
url="https://grpc.io",
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages("."),
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
)

@ -1,4 +1,5 @@
graft src/python/grpcio_csm_observability/grpc_csm_observability.egg-info
graft grpc_csm_observability
include grpc_version.py
include python_version.py
include README.rst

@ -3,9 +3,6 @@ gRPC Python CSM Observability
Package for gRPC Python CSM Observability.
Supported Python Versions
-------------------------
Python >= 3.8
Installation
------------

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csm_observability/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -22,6 +22,8 @@ _README_PATH = os.path.join(_PACKAGE_PATH, "README.rst")
# 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__)))
import python_version
import grpc_version
CLASSIFIERS = [
@ -58,6 +60,6 @@ setuptools.setup(
classifiers=CLASSIFIERS,
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages("."),
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=INSTALL_REQUIRES,
)

@ -1,4 +1,5 @@
include grpc_version.py
include python_version.py
recursive-include grpc_health *.py *.pyi
global-exclude *.pyc
include LICENSE

@ -3,9 +3,6 @@ gRPC Python Health Checking
Reference package for GRPC Python health checking.
Supported Python Versions
-------------------------
Python >= 3.8
Dependencies
------------

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -24,6 +24,8 @@ _README_PATH = os.path.join(_PACKAGE_PATH, "README.rst")
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our local modules.
import python_version
import grpc_version
@ -43,17 +45,18 @@ class _NoOpCommand(setuptools.Command):
pass
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
]
CLASSIFIERS = (
[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
+ [
f"Programming Language :: Python :: {x}"
for x in python_version.SUPPORTED_PYTHON_VERSIONS
]
+ ["License :: OSI Approved :: Apache Software License"]
)
PACKAGE_DIRECTORIES = {
"": ".",
@ -96,7 +99,7 @@ setuptools.setup(
classifiers=CLASSIFIERS,
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages("."),
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS,

@ -4,5 +4,6 @@ graft grpc_root
graft third_party
include _parallel_compile_patch.py
include grpc_version.py
include python_version.py
include observability_lib_deps.py
include README.rst

@ -17,9 +17,6 @@ Note that while this approach enhances efficiency, it will introduce a slight de
time the data is collected and the time it becomes available through Python exporters.
Supported Python Versions
-------------------------
Python >= 3.8
Installation
------------

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_observability/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -34,6 +34,7 @@ sys.path.insert(0, os.path.abspath("."))
import _parallel_compile_patch
import observability_lib_deps
import python_version
import grpc_version
@ -287,7 +288,7 @@ setuptools.setup(
classifiers=CLASSIFIERS,
ext_modules=extension_modules(),
packages=list(PACKAGES),
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=[
"grpcio=={version}".format(version=grpc_version.VERSION),
"setuptools>=59.6.0",

@ -1,4 +1,5 @@
include grpc_version.py
include python_version.py
recursive-include grpc_reflection *.py *.pyi
global-exclude *.pyc
include LICENSE

@ -3,9 +3,6 @@ gRPC Python Reflection package
Reference package for reflection in GRPC Python.
Supported Python Versions
-------------------------
Python >= 3.8
Dependencies
------------

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -25,6 +25,8 @@ _README_PATH = os.path.join(_PACKAGE_PATH, "README.rst")
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our local modules.
import python_version
import grpc_version
@ -44,17 +46,18 @@ class _NoOpCommand(setuptools.Command):
pass
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
]
CLASSIFIERS = (
[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
+ [
f"Programming Language :: Python :: {x}"
for x in python_version.SUPPORTED_PYTHON_VERSIONS
]
+ ["License :: OSI Approved :: Apache Software License"]
)
PACKAGE_DIRECTORIES = {
"": ".",
@ -97,7 +100,7 @@ setuptools.setup(
url="https://grpc.io",
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages("."),
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS,

@ -1,4 +1,5 @@
include grpc_version.py
include python_version.py
include grpc_status/google/rpc/status.proto
recursive-include grpc_status *.py
global-exclude *.pyc

@ -3,9 +3,6 @@ gRPC Python Status Proto
Reference package for GRPC Python status proto mapping.
Supported Python Versions
-------------------------
Python >= 3.8
Dependencies
------------

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -24,6 +24,8 @@ _README_PATH = os.path.join(_PACKAGE_PATH, "README.rst")
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import-style to ensure we can actually find our local modules.
import python_version
import grpc_version
@ -43,17 +45,18 @@ class _NoOpCommand(setuptools.Command):
pass
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
]
CLASSIFIERS = (
[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
+ [
f"Programming Language :: Python :: {x}"
for x in python_version.SUPPORTED_PYTHON_VERSIONS
]
+ ["License :: OSI Approved :: Apache Software License"]
)
PACKAGE_DIRECTORIES = {
"": ".",
@ -93,7 +96,7 @@ setuptools.setup(
classifiers=CLASSIFIERS,
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages("."),
python_requires=">=3.8",
python_requires=f">={python_version.MIN_PYTHON_VERSION}",
install_requires=INSTALL_REQUIRES,
cmdclass=COMMAND_CLASS,
)

@ -3,9 +3,6 @@ gRPC Python Testing Package
Testing utilities for gRPC Python
Supported Python Versions
-------------------------
Python >= 3.8
Dependencies
------------

@ -28,6 +28,7 @@ from tests.unit import test_common
_SERVICE_NAME = "test"
_UNARY_UNARY = "UnaryUnary"
_REQUEST = b"0000"
_UDS_PATH = "/tmp/grpc_fullstack_test.sock"
def _unary_unary_handler(request, context):
@ -52,13 +53,17 @@ _METHOD_HANDLERS = {
def _server():
try:
server = test_common.test_server()
target = "localhost:0"
port = server.add_insecure_port(target)
server.add_registered_method_handlers(_SERVICE_NAME, _METHOD_HANDLERS)
server_creds = grpc.local_server_credentials(
grpc.LocalConnectionType.UDS
)
server.add_secure_port(f"unix:{_UDS_PATH}", server_creds)
server.start()
yield port
yield _UDS_PATH
finally:
server.stop(None)
if os.path.exists(_UDS_PATH):
os.remove(_UDS_PATH)
if contextvars_supported():
@ -103,9 +108,10 @@ else:
class ContextVarsPropagationTest(unittest.TestCase):
def test_propagation_to_auth_plugin(self):
set_up_expected_context()
with _server() as port:
target = "localhost:{}".format(port)
local_credentials = grpc.local_channel_credentials()
with _server() as uds_path:
local_credentials = grpc.local_channel_credentials(
grpc.LocalConnectionType.UDS
)
test_call_credentials = TestCallCredentials()
call_credentials = grpc.metadata_call_credentials(
test_call_credentials, "test call credentials"
@ -113,7 +119,9 @@ class ContextVarsPropagationTest(unittest.TestCase):
composite_credentials = grpc.composite_channel_credentials(
local_credentials, call_credentials
)
with grpc.secure_channel(target, composite_credentials) as channel:
with grpc.secure_channel(
f"unix:{uds_path}", composite_credentials
) as channel:
stub = channel.unary_unary(
grpc._common.fully_qualified_method(
_SERVICE_NAME, _UNARY_UNARY
@ -128,9 +136,10 @@ class ContextVarsPropagationTest(unittest.TestCase):
_RPC_COUNT = 32
set_up_expected_context()
with _server() as port:
target = "localhost:{}".format(port)
local_credentials = grpc.local_channel_credentials()
with _server() as uds_path:
local_credentials = grpc.local_channel_credentials(
grpc.LocalConnectionType.UDS
)
test_call_credentials = TestCallCredentials()
call_credentials = grpc.metadata_call_credentials(
test_call_credentials, "test call credentials"
@ -143,7 +152,7 @@ class ContextVarsPropagationTest(unittest.TestCase):
def _run_on_thread(exception_queue):
try:
with grpc.secure_channel(
target, composite_credentials
f"unix:{uds_path}", composite_credentials
) as channel:
stub = channel.unary_unary(
grpc._common.fully_qualified_method(

@ -208,8 +208,12 @@ class SignalHandlingTest(unittest.TestCase):
self._handler.await_connected_client()
client.send_signal(signal.SIGINT)
client.wait()
print(_read_stream(client_stderr))
self.assertEqual(0, client.returncode)
client_stderr_output = _read_stream(client_stderr)
try:
self.assertEqual(0, client.returncode)
except AssertionError:
print(client_stderr_output, file=sys.stderr)
raise
if __name__ == "__main__":

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -14,6 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!!
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/python_version.py.template`!!!
VERSION = '${settings.python_version.pep440()}'

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csm_observability/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_observability/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpc_version.py.template`!!!
VERSION = '${settings.python_version.pep440()}'
PROTOBUF_VERSION = '${settings.protobuf_version}'

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_tools/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/xds_protos/grpc_version.py.template`!!!
VERSION = '${settings.python_version.pep440()}'
PROTOBUF_VERSION = '${settings.protobuf_version}'

@ -0,0 +1,22 @@
%YAML 1.2
--- |
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/xds_protos/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions}
MIN_PYTHON_VERSION = ${settings.min_python_version}
MAX_PYTHON_VERSION = ${settings.max_python_version}

@ -0,0 +1,14 @@
#=================
# Install ccache
# Install ccache from source since ccache 3.x packaged with most linux distributions
# does not support Redis backend for caching.
RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD STRIP OBJCOPY ${'\\'}
&& curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz ${'\\'}
&& tar -zxf ccache.tar.gz ${'\\'}
&& cd ccache-4.7.5 ${'\\'}
&& mkdir build && cd build ${'\\'}
&& cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. ${'\\'}
&& make -j4 && make install ${'\\'}
&& cd ../.. ${'\\'}
&& rm -rf ccache-4.7.5 ccache.tar.gz

@ -0,0 +1,21 @@
#=================
# Compile CPython 3.13.0rc2 from source
RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean
RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
RUN cd /tmp && ${'\\'}
wget -q https://www.python.org/ftp/python/3.13.0/Python-3.13.0rc2.tgz && ${'\\'}
tar xzvf Python-3.13.0rc2.tgz && ${'\\'}
cd Python-3.13.0rc2 && ${'\\'}
./configure && ${'\\'}
make -j4 && ${'\\'}
make install
RUN cd /tmp && ${'\\'}
echo "ad7f44153649e27ec385e7633e853e03 Python-3.13.0rc2.tgz" > checksum.md5 && ${'\\'}
md5sum -c checksum.md5
RUN python3.13 -m ensurepip && ${'\\'}
python3.13 -m pip install coverage

@ -0,0 +1,22 @@
# TODO: simplify the list of third_party modules list
# NOTE: git>=2.46 allows leading paths like third_party/* to include all subdirectories
# current docker base images use git versions lower than 2.46 and hence require separate configs for each submodule
RUN git config --global --add safe.directory /var/local/jenkins/grpc
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/bloaty
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/xds
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/googleapis
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/googletest
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opentelemetry
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opencensus-proto
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/boringssl-with-bazel
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/envoy-api
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/protobuf
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/zlib
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/benchmark
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/re2
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/abseil-cpp
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opentelemetry-cpp
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/protoc-gen-validate
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/cares/cares
RUN git config --global protocol.file.allow always

@ -0,0 +1,57 @@
%YAML 1.2
--- |
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The aarch64 wheels are being crosscompiled to allow running the build
# on x64 machine. The dockcross/linux-armv7 image is a x86_64
# image with crosscompilation toolchain installed
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile.template`!!!
FROM dockcross/linux-armv7
<%text>RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
libnss3-dev libssl-dev libreadline-dev libffi-dev && apt-get clean</%text>
ADD install_python_for_wheel_crosscompilation.sh /scripts/install_python_for_wheel_crosscompilation.sh
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.8.8" "3.8.8" /opt/python/cp38-cp38
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.9.2" "3.9.2" /opt/python/cp39-cp39
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.10.0" "3.10.0rc1" /opt/python/cp310-cp310
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.11.0" "3.11.0rc1" /opt/python/cp311-cp311
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.12.0" "3.12.0rc2" /opt/python/cp312-cp312
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.13.0" "3.13.0rc2" /opt/python/cp313-cp313
ENV AUDITWHEEL_ARCH armv7l
ENV AUDITWHEEL_PLAT linux_armv7l
<%include file="../ccache_crosscompile.include"/>
# The dockcross base of this image sets CC and CXX to absolute paths, which makes it impossible to redirect their invocations
# to ccache via a symlink. Use relative paths instead.
<%text>
ENV CC ${CROSS_TRIPLE}-gcc
ENV CXX ${CROSS_TRIPLE}-g++
</%text>
# For historical reasons, task_runner.py the script under docker container using "bash -l"
# which loads /etc/profile on startup. dockcross/linux-armv7 is based on an image where
# /etc/profile overwrites contents of PATH (for security reasons) when run as root.
# That causes the crosscompiler binaries located under /usr/xcc/armv7-unknown-linux-gnueabi/bin
# to be removed from PATH. Since in our builds we don't need the /etc/profile for anything, we can just
# truncate it.
# TODO(jtattermusch): Remove this hack when possible.
RUN echo "# file contents removed to avoid resetting PATH set by the docker image" >/etc/profile
<%include file="../git_config.include"/>

@ -0,0 +1,28 @@
%YAML 1.2
--- |
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile.template`!!!
FROM dockcross/manylinux2014-aarch64:20240812-60fa1b0
# manylinux_2_17 is the preferred alias of manylinux2014
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
<%include file="../python_pip_builds.include"/>
<%include file="../ccache_crosscompile.include"/>
<%include file="../git_config.include"/>

@ -0,0 +1,33 @@
%YAML 1.2
--- |
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Docker file for building gRPC manylinux Python artifacts.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile.template`!!!
FROM quay.io/pypa/manylinux2014_x86_64:2024-09-09-f386546
# manylinux_2_17 is the preferred alias of manylinux2014
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
# TODO(jtattermusch): revisit which of the deps are really required
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
<%include file="../python_pip_builds.include"/>
<%include file="../ccache.include"/>
<%include file="../git_config.include"/>

@ -0,0 +1,34 @@
%YAML 1.2
--- |
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Docker file for building gRPC manylinux Python artifacts.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile.template`!!!
FROM quay.io/pypa/manylinux2014_i686:2024-09-09-f386546
# manylinux_2_17 is the preferred alias of manylinux2014
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
# TODO(jtattermusch): revisit which of the deps are really required
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
<%include file="../python_pip_builds.include"/>
<%include file="../ccache.include"/>
<%include file="../git_config.include"/>

@ -0,0 +1,27 @@
%YAML 1.2
--- |
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile.template`!!!
FROM quay.io/pypa/musllinux_1_1_x86_64:2024-09-09-f386546
<%include file="../python_pip_builds.include"/>
<%include file="../ccache.include"/>
<%include file="../git_config.include"/>
RUN apk add openssl openssl-dev

@ -0,0 +1,25 @@
%YAML 1.2
--- |
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile.template`!!!
FROM quay.io/pypa/musllinux_1_1_i686:2024-09-09-f386546
<%include file="../python_pip_builds.include"/>
<%include file="../ccache.include"/>
<%include file="../git_config.include"/>

@ -0,0 +1,8 @@
#===================================
# Install Python build requirements
RUN /opt/python/cp38-cp38/bin/pip install --upgrade 'cython<4.0.0rc1'
RUN /opt/python/cp39-cp39/bin/pip install --upgrade 'cython<4.0.0rc1'
RUN /opt/python/cp310-cp310/bin/pip install --upgrade 'cython<4.0.0rc1'
RUN /opt/python/cp311-cp311/bin/pip install --upgrade 'cython<4.0.0rc1'
RUN /opt/python/cp312-cp312/bin/pip install --upgrade 'cython<4.0.0rc1'
RUN /opt/python/cp313-cp313/bin/pip install --upgrade 'cython<4.0.0rc1'

@ -24,6 +24,7 @@
<%include file="../../compile_python_310.include"/>
<%include file="../../compile_python_311.include"/>
<%include file="../../compile_python_312.include"/>
<%include file="../../compile_python_313.include"/>
# Python test coverage requires libsqlite3, and it have
# to be installed before Python.

@ -637,12 +637,14 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
UDS);
}},
#endif
CoreTestConfiguration{"Chttp2FullstackLocalIpv4",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_DO_NOT_FUZZ |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS,
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS |
FEATURE_MASK_IS_LOCAL_TCP_CREDS,
nullptr,
[](const ChannelArgs& /*client_args*/,
const ChannelArgs& /*server_args*/) {
@ -655,7 +657,8 @@ std::vector<CoreTestConfiguration> DefaultConfigs() {
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
FEATURE_MASK_IS_HTTP2 |
FEATURE_MASK_DO_NOT_FUZZ |
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS,
FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS |
FEATURE_MASK_IS_LOCAL_TCP_CREDS,
nullptr,
[](const ChannelArgs& /*client_args*/,
const ChannelArgs& /*server_args*/) {

@ -84,6 +84,7 @@
// Exclude this fixture from experiment runs
#define FEATURE_MASK_EXCLUDE_FROM_EXPERIMENT_RUNS (1 << 14)
#define FEATURE_MASK_IS_CALL_V3 (1 << 15)
#define FEATURE_MASK_IS_LOCAL_TCP_CREDS (1 << 16)
#define FAIL_AUTH_CHECK_SERVER_ARG_NAME "fail_auth_check"
@ -683,6 +684,11 @@ class CoreEnd2endTestRegistry {
GTEST_SKIP() << "Disabled for initial v3 testing"; \
}
#define SKIP_IF_LOCAL_TCP_CREDS() \
if (GetParam()->feature_mask & FEATURE_MASK_IS_LOCAL_TCP_CREDS) { \
GTEST_SKIP() << "Disabled for Local TCP Connection"; \
}
#define CORE_END2END_TEST(suite, name) \
class CoreEnd2endTest_##suite##_##name : public grpc_core::suite { \
public: \

@ -264,11 +264,17 @@ CORE_END2END_TEST(PerCallCredsOnInsecureTest,
}
CORE_END2END_TEST(PerCallCredsTest, RequestResponseWithPayloadAndCallCreds) {
if (IsLocalConnectorSecureEnabled()) {
SKIP_IF_LOCAL_TCP_CREDS();
}
TestRequestResponseWithPayloadAndCallCreds(*this, true);
}
CORE_END2END_TEST(PerCallCredsTest,
RequestResponseWithPayloadAndOverriddenCallCreds) {
if (IsLocalConnectorSecureEnabled()) {
SKIP_IF_LOCAL_TCP_CREDS();
}
TestRequestResponseWithPayloadAndOverriddenCallCreds(*this, true);
}

@ -93,8 +93,6 @@ class VerifyLogNoiseLogSink : public absl::LogSink {
static const auto* const allowed_logs_by_module =
new std::map<absl::string_view, std::regex>(
{{"cq_verifier.cc", std::regex("^Verify .* for [0-9]+ms")},
{"chttp2_transport.cc",
std::regex("Sending goaway.*Channel Destroyed")},
{"chaotic_good_server.cc",
std::regex("Failed to bind some addresses for.*")},
{"log.cc",

@ -382,6 +382,23 @@ grpc_cc_test(
],
)
grpc_cc_test(
name = "local_security_connector_test",
srcs = ["local_security_connector_test.cc"],
external_deps = [
"absl/log:check",
"gtest",
],
language = "C++",
deps = [
"//:gpr",
"//:grpc",
"//src/core:channel_args",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:grpc_test_util_base",
],
)
grpc_cc_test(
name = "grpc_tls_credentials_options_test",
srcs = ["grpc_tls_credentials_options_test.cc"],

@ -0,0 +1,147 @@
//
//
// Copyright 2024 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#include <gtest/gtest.h>
#include <grpc/impl/grpc_types.h>
#include "src/core/client_channel/client_channel_filter.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/tsi/transport_security.h"
#include "test/core/test_util/test_config.h"
namespace grpc_core {
namespace testing {
namespace {
absl::string_view GetLocalUnixAddress(grpc_endpoint* /*ep*/) { return "unix:"; }
const grpc_endpoint_vtable kUnixEndpointVtable = {
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, GetLocalUnixAddress,
nullptr, nullptr};
absl::string_view GetLocalTcpAddress(grpc_endpoint* /*ep*/) {
return "ipv4:127.0.0.1:12667";
}
const grpc_endpoint_vtable kTcpEndpointVtable = {
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, GetLocalTcpAddress,
nullptr, nullptr};
std::string GetSecurityLevelForServer(grpc_local_connect_type connect_type,
grpc_endpoint& ep) {
grpc_server_credentials* server_creds =
grpc_local_server_credentials_create(connect_type);
ChannelArgs args;
RefCountedPtr<grpc_server_security_connector> connector =
server_creds->create_security_connector(args);
tsi_peer peer;
CHECK(tsi_construct_peer(0, &peer) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
connector->check_peer(peer, &ep, args, &auth_context, nullptr);
tsi_peer_destruct(&peer);
auto it = grpc_auth_context_find_properties_by_name(
auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME);
const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
std::string actual_level;
if (prop != nullptr) {
actual_level = std::string(prop->value, prop->value_length);
}
connector.reset();
auth_context.reset();
grpc_server_credentials_release(server_creds);
return actual_level;
}
std::string GetSecurityLevelForChannel(grpc_local_connect_type connect_type,
grpc_endpoint& ep) {
grpc_channel_credentials* channel_creds =
grpc_local_credentials_create(connect_type);
ChannelArgs args;
args = args.Set((char*)GRPC_ARG_SERVER_URI, (char*)"unix:");
RefCountedPtr<grpc_channel_security_connector> connector =
channel_creds->create_security_connector(nullptr, "unix:", &args);
tsi_peer peer;
CHECK(tsi_construct_peer(0, &peer) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
connector->check_peer(peer, &ep, args, &auth_context, nullptr);
tsi_peer_destruct(&peer);
auto it = grpc_auth_context_find_properties_by_name(
auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME);
const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
std::string actual_level;
if (prop != nullptr) {
actual_level = std::string(prop->value, prop->value_length);
}
connector.reset();
auth_context.reset();
grpc_channel_credentials_release(channel_creds);
return actual_level;
}
TEST(LocalSecurityConnectorTest, CheckSecurityLevelOfUdsConnectionServer) {
grpc_endpoint ep;
ep.vtable = &kUnixEndpointVtable;
std::string actual_level = GetSecurityLevelForServer(UDS, ep);
ASSERT_EQ(actual_level,
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY));
}
TEST(LocalSecurityConnectorTest, SecurityLevelOfTcpConnectionServer) {
grpc_endpoint ep;
ep.vtable = &kTcpEndpointVtable;
std::string actual_level = GetSecurityLevelForServer(LOCAL_TCP, ep);
ASSERT_EQ(actual_level,
IsLocalConnectorSecureEnabled()
? tsi_security_level_to_string(TSI_SECURITY_NONE)
: tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY));
}
TEST(LocalSecurityConnectorTest, CheckSecurityLevelOfUdsConnectionChannel) {
grpc_endpoint ep;
ep.vtable = &kUnixEndpointVtable;
std::string actual_level = GetSecurityLevelForChannel(UDS, ep);
ASSERT_EQ(actual_level,
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY));
}
TEST(LocalSecurityConnectorTest, SecurityLevelOfTcpConnectionChannel) {
grpc_endpoint ep;
ep.vtable = &kTcpEndpointVtable;
std::string actual_level = GetSecurityLevelForChannel(LOCAL_TCP, ep);
ASSERT_EQ(actual_level,
IsLocalConnectorSecureEnabled()
? tsi_security_level_to_string(TSI_SECURITY_NONE)
: tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY));
}
} // namespace
} // namespace testing
} // namespace grpc_core
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();
grpc_shutdown();
return ret;
}

@ -29,7 +29,7 @@ load("@com_google_protobuf//bazel:system_python.bzl", "system_python")
system_python(
name = "system_python",
minimum_python_version = "3.7",
minimum_python_version = "3.8",
)
load("@system_python//:pip.bzl", "pip_parse")

@ -63,12 +63,12 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/grpc_artifact_centos6_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_centos6_x64@sha256:3285047265ea2b7c5d4df4c769b2d05f56288d947c75e16d27ae2dee693f791b",
"tools/dockerfile/grpc_artifact_centos6_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_centos6_x86@sha256:19783239da92208f0f39cf563529cd02e889920497ef81c60d20391fa998af62",
"tools/dockerfile/grpc_artifact_protoc_aarch64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_protoc_aarch64@sha256:a0f6b544c1b2fa75f73b26cb28281917153304e9df2789e93de0732494e6b651",
"tools/dockerfile/grpc_artifact_python_linux_armv7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_linux_armv7@sha256:f109d6c22cadb053f6843a66ee827d74f34d6cbf75a32f455a9da099ed1bdc9c",
"tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_aarch64@sha256:3f0407d4db904b35a7665c2222db039994cd0c9bdb1a073a653ff8e6940081c9",
"tools/dockerfile/grpc_artifact_python_manylinux2014_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x64@sha256:89329900ec7fedc57cd89690acd34d07d726f6b896f60df987867737d0a0f5a8",
"tools/dockerfile/grpc_artifact_python_manylinux2014_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x86@sha256:8fce8e094b00935dc1f2640b4c2b10216c5a8711c0f4444efbafcd8c355a75a8",
"tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x64@sha256:c8e8eb24942a2910197cf5481d61e7cbce68b57bd6f35fae878b043b1f2c38bb",
"tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x86@sha256:c288f83435186ee675d004ee52c93195a51201bf2b5fe92581584d977a2499a3",
"tools/dockerfile/grpc_artifact_python_linux_armv7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_linux_armv7@sha256:137616275fe59bf89849f7503779f9a5d9668dbf395fcc79a8221a8c38fa5bac",
"tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_aarch64@sha256:ad3233be3c3ad9e0c4b60f0176a853713a35e5c84ec9d9703996c67fa3e811b6",
"tools/dockerfile/grpc_artifact_python_manylinux2014_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x64@sha256:0e102df67f31aeb6afe68250603288c2f1c98ccf360d1c42d751b8451da94b48",
"tools/dockerfile/grpc_artifact_python_manylinux2014_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_x86@sha256:527e2e9ec4db0c52a53b50abfd59907a1b7e221168dc401686f6a48d33bddc5c",
"tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x64@sha256:94b57e5ea31ebc29af734474bcaff3074770778e5d27557cdc06d755ee8bc7ed",
"tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_musllinux_1_1_x86@sha256:edf4a0c8333c9309e52f323aa7315bbc0e5643216613cab4ecd2bce3d1ec26c0",
"tools/dockerfile/interoptest/grpc_interop_aspnetcore.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_aspnetcore@sha256:8e2e732e78724a8382c340dca72e7653c5f82c251a3110fa2874cc00ba538878",
"tools/dockerfile/interoptest/grpc_interop_cxx.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_cxx@sha256:e5a474d33773d52ec6a8abbe2d61ee0c2a9c2b5f48793a5ea3b82c4445becf3f",
"tools/dockerfile/interoptest/grpc_interop_dart.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_dart@sha256:4915a280788126dad029858eb384dbbef2dc18cadccb434df6450dfd7a4929f2",
@ -109,7 +109,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/test/php7_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64@sha256:34b02fd66832ebf49601bef95632753e6710a75755401c21332d50056ccd52d2",
"tools/dockerfile/test/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:0a4e3c166fb676d85ea26d9fffec3858d59a2f243a3acc1c2f9bd293a590a98c",
"tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:fccca33a655c7aa89dd7ebd9492cbcc1f636bd2a004cd939d1982cfce3d68326",
"tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:4c539fc93d343324309939c2964204c90f4054cd9eeed093af315cb0f0ef7c26",
"tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:8beca964d6bbb80a8cb4c4628c25e9702b007c97113e74e589fa50c15000738d",
"tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:b3eb1a17b7b091e3c5648a803076b2c40601242ff91c04d55997af6641305f68",
"tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:d2e79919b2e2d4cc36a29682ecb5170641df4fb506cfb453978ffdeb8a841bd9",
"tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:6e8b4696ba0661f11a31ed0992a94d2efcd889a018f57160f0e2fb62963f3593",

@ -269,8 +269,8 @@ grpc_build_artifact_task(
# Python artifact build tasks
grpc_build_artifact_task(
name = "artifact_python_linux_x64_manylinux2014_cp312",
build_script = "build_artifact_python_linux_x64_cp312.sh",
name = "artifact_python_linux_x64_manylinux2014_cp313",
build_script = "build_artifact_python_linux_x64_cp313.sh",
docker_image_version = "tools/dockerfile/grpc_artifact_python_manylinux2014_x64.current_version",
)
@ -287,7 +287,7 @@ grpc_build_artifact_task(
name = "package_python_linux",
# TODO(jtattermusch): add more python artifacts once they are migrated from artifact_targets.py
artifact_deps = [
"artifact_python_linux_x64_manylinux2014_cp312",
"artifact_python_linux_x64_manylinux2014_cp313",
"artifact_python_linux_x64_manylinux2014_cp39",
],
build_script = "build_package_python_linux.sh",
@ -421,7 +421,7 @@ test_suite(
":artifact_protoc_linux_aarch64_build_test",
":artifact_protoc_linux_x64_build_test",
":artifact_protoc_linux_x86_build_test",
":artifact_python_linux_x64_manylinux2014_cp312_build_test",
":artifact_python_linux_x64_manylinux2014_cp313_build_test",
":artifact_python_linux_x64_manylinux2014_cp39_build_test",
":package_csharp_linux_build_test",
":package_python_linux_build_test",

@ -17,8 +17,8 @@ set -ex
# env variable values extracted from PythonArtifact in tools/run_tests/artifacts/artifact_targets.py
# TODO(jtattermusch): find a better way of configuring the python artifact build (the current approach mostly serves as a demonstration)
export PYTHON=/opt/python/cp312-cp312/bin/python
export PIP=/opt/python/cp312-cp312/bin/pip
export PYTHON=/opt/python/cp313-cp313/bin/python
export PIP=/opt/python/cp313-cp313/bin/pip
export GRPC_SKIP_PIP_CYTHON_UPGRADE=TRUE
export GRPC_RUN_AUDITWHEEL_REPAIR=TRUE
export GRPC_BUILD_GRPCIO_TOOLS_DEPENDENTS=TRUE

@ -0,0 +1,33 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Buildgen python version plugin
This parses the list of supported python versions from the yaml build file, and
creates custom strings for the minimum and maximum supported python versions.
"""
def mako_plugin(dictionary):
"""Expand version numbers:
- for each language, ensure there's a language_version tag in
settings (defaulting to the master version tag)
- expand version strings to major, minor, patch, and tag
"""
settings = dictionary["settings"]
supported_python_versions = settings["supported_python_versions"]
settings["min_python_version"] = supported_python_versions[0]
settings["max_python_version"] = supported_python_versions[-1]

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 The gRPC Authors
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,45 +13,49 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO: Integrate this into CI to avoid bitrot.
set -ex
echo "It's recommended that you run this script from a virtual environment."
BASEDIR=$(dirname "$0")/../..
PACKAGES="grpcio_channelz grpcio_csds grpcio_admin grpcio_health_checking grpcio_reflection grpcio_status grpcio_testing grpcio_csm_observability grpcio_tests"
# Change to grpc repo root
cd "$BASEDIR";
# unit-tests setup starts from here
function maybe_run_command () {
if python setup.py --help-commands | grep "$1" &>/dev/null; then
python setup.py "$1";
if python3 setup.py --help-commands | grep "$1" &>/dev/null; then
python3 setup.py "$1";
fi
}
set -e
python3 -m pip install --upgrade "cython<4.0.0rc1";
python3 setup.py install;
BASEDIR=$(dirname "$0")
BASEDIR=$(realpath "$BASEDIR")/../..
# Build and install grpcio_tools
pushd tools/distrib/python/grpcio_tools;
../make_grpcio_tools.py
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
popd;
PACKAGES="grpcio_channelz grpcio_csds grpcio_admin grpcio_health_checking grpcio_reflection grpcio_status grpcio_testing grpcio_csm_observability grpcio_tests"
# Build and install grpcio_observability
pushd src/python/grpcio_observability;
./make_grpcio_observability.py
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
popd;
# Install xds_protos
pushd tools/distrib/python/xds_protos;
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
popd;
(cd "$BASEDIR";
pip install --upgrade "cython<3.0.0rc1";
python setup.py install;
pushd tools/distrib/python/grpcio_tools;
../make_grpcio_tools.py
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
popd;
pushd src/python/grpcio_observability;
./make_grpcio_observability.py
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
popd;
pushd tools/distrib/python/xds_protos;
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
popd;
pushd src/python;
for PACKAGE in ${PACKAGES}; do
pushd "${PACKAGE}";
python setup.py clean;
maybe_run_command preprocess
maybe_run_command build_package_protos
python -m pip install .;
popd;
done
popd;
)
# Build and install individual gRPC packages
pushd src/python;
for PACKAGE in ${PACKAGES}; do
pushd "${PACKAGE}";
python3 setup.py clean;
maybe_run_command preprocess
maybe_run_command build_package_protos
python3 -m pip install .;
popd;
done
popd;

@ -0,0 +1,25 @@
#!/bin/bash
# Copyright 2024 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
BASEDIR=$(dirname "$0")/../..
cd "$BASEDIR";
# install python all modules
./tools/distrib/install_all_python_modules.sh
# run python tooling tests
./tools/distrib/python_tooling_tests.sh

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpc_version.py.template`!!!
VERSION = '1.68.0.dev0'
PROTOBUF_VERSION = '3.28.1'

@ -1,10 +1,12 @@
include _parallel_compile_patch.py
include _spawn_patch.py
include grpc_version.py
include python_version.py
include protoc_deps.py
include protoc_lib_deps.py
include README.rst
include grpc_tools/grpc_version.py
include grpc_tools/python_version.py
graft grpc_tools
graft grpc_root
graft third_party

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_tools/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

@ -0,0 +1,20 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/python_version.py.template`!!!
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
MIN_PYTHON_VERSION = 3.8
MAX_PYTHON_VERSION = 3.13

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save