1# Copyright 2015 gRPC authors. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14"""A setup module for the GRPC Python package.""" 15 16# setuptools need to be imported before distutils. Otherwise it might lead to 17# undesirable behaviors or errors. 18import setuptools 19 20# Monkey Patch the unix compiler to accept ASM 21# files used by boring SSL. 22from distutils.unixccompiler import UnixCCompiler 23UnixCCompiler.src_extensions.append('.S') 24del UnixCCompiler 25 26from distutils import cygwinccompiler 27from distutils import extension as _extension 28from distutils import util 29import os 30import os.path 31import pkg_resources 32import platform 33import re 34import shlex 35import shutil 36import sys 37import sysconfig 38 39from setuptools.command import egg_info 40 41import subprocess 42from subprocess import PIPE 43 44# Redirect the manifest template from MANIFEST.in to PYTHON-MANIFEST.in. 45egg_info.manifest_maker.template = 'PYTHON-MANIFEST.in' 46 47PY3 = sys.version_info.major == 3 48PYTHON_STEM = os.path.join('src', 'python', 'grpcio') 49CORE_INCLUDE = ( 50 'include', 51 '.', 52) 53ABSL_INCLUDE = (os.path.join('third_party', 'abseil-cpp'),) 54ADDRESS_SORTING_INCLUDE = (os.path.join('third_party', 'address_sorting', 55 'include'),) 56CARES_INCLUDE = ( 57 os.path.join('third_party', 'cares'), 58 os.path.join('third_party', 'cares', 'cares'), 59) 60if 'darwin' in sys.platform: 61 CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_darwin'),) 62if 'freebsd' in sys.platform: 63 CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_freebsd'),) 64if 'linux' in sys.platform: 65 CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_linux'),) 66if 'openbsd' in sys.platform: 67 CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_openbsd'),) 68RE2_INCLUDE = (os.path.join('third_party', 're2'),) 69SSL_INCLUDE = (os.path.join('third_party', 'boringssl-with-bazel', 'src', 70 'include'),) 71UPB_INCLUDE = (os.path.join('third_party', 'upb'),) 72UPB_GRPC_GENERATED_INCLUDE = (os.path.join('src', 'core', 'ext', 73 'upb-generated'),) 74UPBDEFS_GRPC_GENERATED_INCLUDE = (os.path.join('src', 'core', 'ext', 75 'upbdefs-generated'),) 76XXHASH_INCLUDE = (os.path.join('third_party', 'xxhash'),) 77ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),) 78README = os.path.join(PYTHON_STEM, 'README.rst') 79 80# Ensure we're in the proper directory whether or not we're being used by pip. 81os.chdir(os.path.dirname(os.path.abspath(__file__))) 82sys.path.insert(0, os.path.abspath(PYTHON_STEM)) 83 84# Break import-style to ensure we can actually find our in-repo dependencies. 85import _parallel_compile_patch 86import _spawn_patch 87import commands 88import grpc_core_dependencies 89import grpc_version 90 91_parallel_compile_patch.monkeypatch_compile_maybe() 92_spawn_patch.monkeypatch_spawn() 93 94LICENSE = 'Apache License 2.0' 95 96CLASSIFIERS = [ 97 'Development Status :: 5 - Production/Stable', 98 'Programming Language :: Python', 99 'Programming Language :: Python :: 2', 100 'Programming Language :: Python :: 2.7', 101 'Programming Language :: Python :: 3', 102 'Programming Language :: Python :: 3.5', 103 'Programming Language :: Python :: 3.6', 104 'Programming Language :: Python :: 3.7', 105 'Programming Language :: Python :: 3.8', 106 'Programming Language :: Python :: 3.9', 107 'License :: OSI Approved :: Apache Software License', 108] 109 110 111def _env_bool_value(env_name, default): 112 """Parses a bool option from an environment variable""" 113 return os.environ.get(env_name, default).upper() not in ['FALSE', '0', ''] 114 115 116BUILD_WITH_BORING_SSL_ASM = _env_bool_value('GRPC_BUILD_WITH_BORING_SSL_ASM', 117 'True') 118 119# Export this environment variable to override the platform variant that will 120# be chosen for boringssl assembly optimizations. This option is useful when 121# crosscompiling and the host platform as obtained by distutils.utils.get_platform() 122# doesn't match the platform we are targetting. 123# Example value: "linux-aarch64" 124BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM = os.environ.get( 125 'GRPC_BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM', '') 126 127# Environment variable to determine whether or not the Cython extension should 128# *use* Cython or use the generated C files. Note that this requires the C files 129# to have been generated by building first *with* Cython support. Even if this 130# is set to false, if the script detects that the generated `.c` file isn't 131# present, then it will still attempt to use Cython. 132BUILD_WITH_CYTHON = _env_bool_value('GRPC_PYTHON_BUILD_WITH_CYTHON', 'False') 133 134# Export this variable to use the system installation of openssl. You need to 135# have the header files installed (in /usr/include/openssl) and during 136# runtime, the shared library must be installed 137BUILD_WITH_SYSTEM_OPENSSL = _env_bool_value('GRPC_PYTHON_BUILD_SYSTEM_OPENSSL', 138 'False') 139 140# Export this variable to use the system installation of zlib. You need to 141# have the header files installed (in /usr/include/) and during 142# runtime, the shared library must be installed 143BUILD_WITH_SYSTEM_ZLIB = _env_bool_value('GRPC_PYTHON_BUILD_SYSTEM_ZLIB', 144 'False') 145 146# Export this variable to use the system installation of cares. You need to 147# have the header files installed (in /usr/include/) and during 148# runtime, the shared library must be installed 149BUILD_WITH_SYSTEM_CARES = _env_bool_value('GRPC_PYTHON_BUILD_SYSTEM_CARES', 150 'False') 151 152# Export this variable to use the system installation of re2. You need to 153# have the header files installed (in /usr/include/re2) and during 154# runtime, the shared library must be installed 155BUILD_WITH_SYSTEM_RE2 = _env_bool_value('GRPC_PYTHON_BUILD_SYSTEM_RE2', 'False') 156 157# Export this variable to force building the python extension with a statically linked libstdc++. 158# At least on linux, this is normally not needed as we can build manylinux-compatible wheels on linux just fine 159# without statically linking libstdc++ (which leads to a slight increase in the wheel size). 160# This option is useful when crosscompiling wheels for aarch64 where 161# it's difficult to ensure that the crosscompilation toolchain has a high-enough version 162# of GCC (we require >4.9) but still uses old-enough libstdc++ symbols. 163# TODO(jtattermusch): remove this workaround once issues with crosscompiler version are resolved. 164BUILD_WITH_STATIC_LIBSTDCXX = _env_bool_value( 165 'GRPC_PYTHON_BUILD_WITH_STATIC_LIBSTDCXX', 'False') 166 167# For local development use only: This skips building gRPC Core and its 168# dependencies, including protobuf and boringssl. This allows "incremental" 169# compilation by first building gRPC Core using make, then building only the 170# Python/Cython layers here. 171# 172# Note that this requires libboringssl.a in the libs/{dbg,opt}/ directory, which 173# may require configuring make to not use the system openssl implementation: 174# 175# make HAS_SYSTEM_OPENSSL_ALPN=0 176# 177# TODO(ericgribkoff) Respect the BUILD_WITH_SYSTEM_* flags alongside this option 178USE_PREBUILT_GRPC_CORE = _env_bool_value('GRPC_PYTHON_USE_PREBUILT_GRPC_CORE', 179 'False') 180 181# If this environmental variable is set, GRPC will not try to be compatible with 182# libc versions old than the one it was compiled against. 183DISABLE_LIBC_COMPATIBILITY = _env_bool_value( 184 'GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY', 'False') 185 186# Environment variable to determine whether or not to enable coverage analysis 187# in Cython modules. 188ENABLE_CYTHON_TRACING = _env_bool_value('GRPC_PYTHON_ENABLE_CYTHON_TRACING', 189 'False') 190 191# Environment variable specifying whether or not there's interest in setting up 192# documentation building. 193ENABLE_DOCUMENTATION_BUILD = _env_bool_value( 194 'GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD', 'False') 195 196 197def check_linker_need_libatomic(): 198 """Test if linker on system needs libatomic.""" 199 code_test = (b'#include <atomic>\n' + 200 b'int main() { return std::atomic<int64_t>{}; }') 201 cxx = os.environ.get('CXX', 'c++') 202 cpp_test = subprocess.Popen([cxx, '-x', 'c++', '-std=c++11', '-'], 203 stdin=PIPE, 204 stdout=PIPE, 205 stderr=PIPE) 206 cpp_test.communicate(input=code_test) 207 if cpp_test.returncode == 0: 208 return False 209 # Double-check to see if -latomic actually can solve the problem. 210 # https://github.com/grpc/grpc/issues/22491 211 cpp_test = subprocess.Popen( 212 [cxx, '-x', 'c++', '-std=c++11', '-latomic', '-'], 213 stdin=PIPE, 214 stdout=PIPE, 215 stderr=PIPE) 216 cpp_test.communicate(input=code_test) 217 return cpp_test.returncode == 0 218 219 220# There are some situations (like on Windows) where CC, CFLAGS, and LDFLAGS are 221# entirely ignored/dropped/forgotten by distutils and its Cygwin/MinGW support. 222# We use these environment variables to thus get around that without locking 223# ourselves in w.r.t. the multitude of operating systems this ought to build on. 224# We can also use these variables as a way to inject environment-specific 225# compiler/linker flags. We assume GCC-like compilers and/or MinGW as a 226# reasonable default. 227EXTRA_ENV_COMPILE_ARGS = os.environ.get('GRPC_PYTHON_CFLAGS', None) 228EXTRA_ENV_LINK_ARGS = os.environ.get('GRPC_PYTHON_LDFLAGS', None) 229if EXTRA_ENV_COMPILE_ARGS is None: 230 EXTRA_ENV_COMPILE_ARGS = ' -std=c++11' 231 if 'win32' in sys.platform: 232 if sys.version_info < (3, 5): 233 EXTRA_ENV_COMPILE_ARGS += ' -D_hypot=hypot' 234 # We use define flags here and don't directly add to DEFINE_MACROS below to 235 # ensure that the expert user/builder has a way of turning it off (via the 236 # envvars) without adding yet more GRPC-specific envvars. 237 # See https://sourceforge.net/p/mingw-w64/bugs/363/ 238 if '32' in platform.architecture()[0]: 239 EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime32 -D_timeb=__timeb32 -D_ftime_s=_ftime32_s' 240 else: 241 EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime64 -D_timeb=__timeb64' 242 else: 243 # We need to statically link the C++ Runtime, only the C runtime is 244 # available dynamically 245 EXTRA_ENV_COMPILE_ARGS += ' /MT' 246 elif "linux" in sys.platform: 247 EXTRA_ENV_COMPILE_ARGS += ' -std=gnu99 -fvisibility=hidden -fno-wrapv -fno-exceptions' 248 elif "darwin" in sys.platform: 249 EXTRA_ENV_COMPILE_ARGS += ' -stdlib=libc++ -fvisibility=hidden -fno-wrapv -fno-exceptions' 250 251if EXTRA_ENV_LINK_ARGS is None: 252 EXTRA_ENV_LINK_ARGS = '' 253 if "linux" in sys.platform or "darwin" in sys.platform: 254 EXTRA_ENV_LINK_ARGS += ' -lpthread' 255 if check_linker_need_libatomic(): 256 EXTRA_ENV_LINK_ARGS += ' -latomic' 257 elif "win32" in sys.platform and sys.version_info < (3, 5): 258 msvcr = cygwinccompiler.get_msvcr()[0] 259 EXTRA_ENV_LINK_ARGS += ( 260 ' -static-libgcc -static-libstdc++ -mcrtdll={msvcr}' 261 ' -static -lshlwapi'.format(msvcr=msvcr)) 262 if "linux" in sys.platform: 263 EXTRA_ENV_LINK_ARGS += ' -Wl,-wrap,memcpy -static-libgcc' 264 265EXTRA_COMPILE_ARGS = shlex.split(EXTRA_ENV_COMPILE_ARGS) 266EXTRA_LINK_ARGS = shlex.split(EXTRA_ENV_LINK_ARGS) 267 268if BUILD_WITH_STATIC_LIBSTDCXX: 269 EXTRA_LINK_ARGS.append('-static-libstdc++') 270 271CYTHON_EXTENSION_PACKAGE_NAMES = () 272 273CYTHON_EXTENSION_MODULE_NAMES = ('grpc._cython.cygrpc',) 274 275CYTHON_HELPER_C_FILES = () 276 277CORE_C_FILES = tuple(grpc_core_dependencies.CORE_SOURCE_FILES) 278if "win32" in sys.platform: 279 CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES) 280 281if BUILD_WITH_SYSTEM_OPENSSL: 282 CORE_C_FILES = filter(lambda x: 'third_party/boringssl' not in x, 283 CORE_C_FILES) 284 CORE_C_FILES = filter(lambda x: 'src/boringssl' not in x, CORE_C_FILES) 285 SSL_INCLUDE = (os.path.join('/usr', 'include', 'openssl'),) 286 287if BUILD_WITH_SYSTEM_ZLIB: 288 CORE_C_FILES = filter(lambda x: 'third_party/zlib' not in x, CORE_C_FILES) 289 ZLIB_INCLUDE = (os.path.join('/usr', 'include'),) 290 291if BUILD_WITH_SYSTEM_CARES: 292 CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES) 293 CARES_INCLUDE = (os.path.join('/usr', 'include'),) 294 295if BUILD_WITH_SYSTEM_RE2: 296 CORE_C_FILES = filter(lambda x: 'third_party/re2' not in x, CORE_C_FILES) 297 RE2_INCLUDE = (os.path.join('/usr', 'include', 're2'),) 298 299EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE + 300 ADDRESS_SORTING_INCLUDE + CARES_INCLUDE + 301 RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE + 302 UPB_GRPC_GENERATED_INCLUDE + 303 UPBDEFS_GRPC_GENERATED_INCLUDE + 304 XXHASH_INCLUDE + ZLIB_INCLUDE) 305 306EXTENSION_LIBRARIES = () 307if "linux" in sys.platform: 308 EXTENSION_LIBRARIES += ('rt',) 309if not "win32" in sys.platform: 310 EXTENSION_LIBRARIES += ('m',) 311if "win32" in sys.platform: 312 EXTENSION_LIBRARIES += ( 313 'advapi32', 314 'ws2_32', 315 'dbghelp', 316 ) 317if BUILD_WITH_SYSTEM_OPENSSL: 318 EXTENSION_LIBRARIES += ( 319 'ssl', 320 'crypto', 321 ) 322if BUILD_WITH_SYSTEM_ZLIB: 323 EXTENSION_LIBRARIES += ('z',) 324if BUILD_WITH_SYSTEM_CARES: 325 EXTENSION_LIBRARIES += ('cares',) 326if BUILD_WITH_SYSTEM_RE2: 327 EXTENSION_LIBRARIES += ('re2',) 328 329DEFINE_MACROS = (('_WIN32_WINNT', 0x600),) 330asm_files = [] 331 332asm_key = '' 333if BUILD_WITH_BORING_SSL_ASM and not BUILD_WITH_SYSTEM_OPENSSL: 334 boringssl_asm_platform = BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM if BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM else util.get_platform( 335 ) 336 LINUX_X86_64 = 'linux-x86_64' 337 LINUX_ARM = 'linux-arm' 338 LINUX_AARCH64 = 'linux-aarch64' 339 if LINUX_X86_64 == boringssl_asm_platform: 340 asm_key = 'crypto_linux_x86_64' 341 elif LINUX_ARM == boringssl_asm_platform: 342 asm_key = 'crypto_linux_arm' 343 elif LINUX_AARCH64 == boringssl_asm_platform: 344 asm_key = 'crypto_linux_aarch64' 345 elif "mac" in boringssl_asm_platform and "x86_64" in boringssl_asm_platform: 346 asm_key = 'crypto_mac_x86_64' 347 else: 348 print("ASM Builds for BoringSSL currently not supported on:", 349 boringssl_asm_platform) 350if asm_key: 351 asm_files = grpc_core_dependencies.ASM_SOURCE_FILES[asm_key] 352else: 353 DEFINE_MACROS += (('OPENSSL_NO_ASM', 1),) 354 355if not DISABLE_LIBC_COMPATIBILITY: 356 DEFINE_MACROS += (('GPR_BACKWARDS_COMPATIBILITY_MODE', 1),) 357 358if "win32" in sys.platform: 359 # TODO(zyc): Re-enable c-ares on x64 and x86 windows after fixing the 360 # ares_library_init compilation issue 361 DEFINE_MACROS += ( 362 ('WIN32_LEAN_AND_MEAN', 1), 363 ('CARES_STATICLIB', 1), 364 ('GRPC_ARES', 0), 365 ('NTDDI_VERSION', 0x06000000), 366 ('NOMINMAX', 1), 367 ) 368 if '64bit' in platform.architecture()[0]: 369 DEFINE_MACROS += (('MS_WIN64', 1),) 370 elif sys.version_info >= (3, 5): 371 # For some reason, this is needed to get access to inet_pton/inet_ntop 372 # on msvc, but only for 32 bits 373 DEFINE_MACROS += (('NTDDI_VERSION', 0x06000000),) 374else: 375 DEFINE_MACROS += ( 376 ('HAVE_CONFIG_H', 1), 377 ('GRPC_ENABLE_FORK_SUPPORT', 1), 378 ) 379 380LDFLAGS = tuple(EXTRA_LINK_ARGS) 381CFLAGS = tuple(EXTRA_COMPILE_ARGS) 382if "linux" in sys.platform or "darwin" in sys.platform: 383 pymodinit_type = 'PyObject*' if PY3 else 'void' 384 pymodinit = 'extern "C" __attribute__((visibility ("default"))) {}'.format( 385 pymodinit_type) 386 DEFINE_MACROS += (('PyMODINIT_FUNC', pymodinit),) 387 DEFINE_MACROS += (('GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK', 1),) 388 389# By default, Python3 distutils enforces compatibility of 390# c plugins (.so files) with the OSX version Python was built with. 391# We need OSX 10.10, the oldest which supports C++ thread_local. 392# Python 3.9: Mac OS Big Sur sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') returns int (11) 393if 'darwin' in sys.platform: 394 mac_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') 395 if mac_target: 396 mac_target = pkg_resources.parse_version(str(mac_target)) 397 if mac_target < pkg_resources.parse_version('10.10.0'): 398 os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.10' 399 os.environ['_PYTHON_HOST_PLATFORM'] = re.sub( 400 r'macosx-[0-9]+\.[0-9]+-(.+)', r'macosx-10.10-\1', 401 util.get_platform()) 402 403 404def cython_extensions_and_necessity(): 405 cython_module_files = [ 406 os.path.join(PYTHON_STEM, 407 name.replace('.', '/') + '.pyx') 408 for name in CYTHON_EXTENSION_MODULE_NAMES 409 ] 410 config = os.environ.get('CONFIG', 'opt') 411 prefix = 'libs/' + config + '/' 412 if USE_PREBUILT_GRPC_CORE: 413 extra_objects = [ 414 prefix + 'libares.a', prefix + 'libboringssl.a', 415 prefix + 'libgpr.a', prefix + 'libgrpc.a' 416 ] 417 core_c_files = [] 418 else: 419 core_c_files = list(CORE_C_FILES) 420 extra_objects = [] 421 extensions = [ 422 _extension.Extension( 423 name=module_name, 424 sources=([module_file] + list(CYTHON_HELPER_C_FILES) + 425 core_c_files + asm_files), 426 include_dirs=list(EXTENSION_INCLUDE_DIRECTORIES), 427 libraries=list(EXTENSION_LIBRARIES), 428 define_macros=list(DEFINE_MACROS), 429 extra_objects=extra_objects, 430 extra_compile_args=list(CFLAGS), 431 extra_link_args=list(LDFLAGS), 432 ) for (module_name, module_file 433 ) in zip(list(CYTHON_EXTENSION_MODULE_NAMES), cython_module_files) 434 ] 435 need_cython = BUILD_WITH_CYTHON 436 if not BUILD_WITH_CYTHON: 437 need_cython = need_cython or not commands.check_and_update_cythonization( 438 extensions) 439 # TODO: the strategy for conditional compiling and exposing the aio Cython 440 # dependencies will be revisited by https://github.com/grpc/grpc/issues/19728 441 return commands.try_cythonize(extensions, 442 linetracing=ENABLE_CYTHON_TRACING, 443 mandatory=BUILD_WITH_CYTHON), need_cython 444 445 446CYTHON_EXTENSION_MODULES, need_cython = cython_extensions_and_necessity() 447 448PACKAGE_DIRECTORIES = { 449 '': PYTHON_STEM, 450} 451 452INSTALL_REQUIRES = ( 453 "six>=1.5.2", 454 "futures>=2.2.0; python_version<'3.2'", 455 "enum34>=1.0.4; python_version<'3.4'", 456) 457EXTRAS_REQUIRES = { 458 'protobuf': 'grpcio-tools>={version}'.format(version=grpc_version.VERSION), 459} 460 461SETUP_REQUIRES = INSTALL_REQUIRES + ( 462 'Sphinx~=1.8.1', 463 'six>=1.10', 464) if ENABLE_DOCUMENTATION_BUILD else () 465 466try: 467 import Cython 468except ImportError: 469 if BUILD_WITH_CYTHON: 470 sys.stderr.write( 471 "You requested a Cython build via GRPC_PYTHON_BUILD_WITH_CYTHON, " 472 "but do not have Cython installed. We won't stop you from using " 473 "other commands, but the extension files will fail to build.\n") 474 elif need_cython: 475 sys.stderr.write( 476 'We could not find Cython. Setup may take 10-20 minutes.\n') 477 SETUP_REQUIRES += ('cython>=0.23',) 478 479COMMAND_CLASS = { 480 'doc': commands.SphinxDocumentation, 481 'build_project_metadata': commands.BuildProjectMetadata, 482 'build_py': commands.BuildPy, 483 'build_ext': commands.BuildExt, 484 'gather': commands.Gather, 485 'clean': commands.Clean, 486} 487 488# Ensure that package data is copied over before any commands have been run: 489credentials_dir = os.path.join(PYTHON_STEM, 'grpc', '_cython', '_credentials') 490try: 491 os.mkdir(credentials_dir) 492except OSError: 493 pass 494shutil.copyfile(os.path.join('etc', 'roots.pem'), 495 os.path.join(credentials_dir, 'roots.pem')) 496 497PACKAGE_DATA = { 498 # Binaries that may or may not be present in the final installation, but are 499 # mentioned here for completeness. 500 'grpc._cython': [ 501 '_credentials/roots.pem', 502 '_windows/grpc_c.32.python', 503 '_windows/grpc_c.64.python', 504 ], 505} 506PACKAGES = setuptools.find_packages(PYTHON_STEM) 507 508setuptools.setup( 509 name='grpcio', 510 version=grpc_version.VERSION, 511 description='HTTP/2-based RPC framework', 512 author='The gRPC Authors', 513 author_email='grpc-io@googlegroups.com', 514 url='https://grpc.io', 515 license=LICENSE, 516 classifiers=CLASSIFIERS, 517 long_description=open(README).read(), 518 ext_modules=CYTHON_EXTENSION_MODULES, 519 packages=list(PACKAGES), 520 package_dir=PACKAGE_DIRECTORIES, 521 package_data=PACKAGE_DATA, 522 install_requires=INSTALL_REQUIRES, 523 extras_require=EXTRAS_REQUIRES, 524 setup_requires=SETUP_REQUIRES, 525 cmdclass=COMMAND_CLASS, 526) 527