src/python/grpcio_status/setup.py
Go to the documentation of this file.
1 # Copyright 2018 The 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 """Setup module for the GRPC Python package's status mapping."""
15 
16 import os
17 
18 import setuptools
19 
20 _PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__))
21 _README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst')
22 
23 # Ensure we're in the proper directory whether or not we're being used by pip.
24 os.chdir(os.path.dirname(os.path.abspath(__file__)))
25 
26 # Break import-style to ensure we can actually find our local modules.
27 import grpc_version
28 
29 
30 class _NoOpCommand(setuptools.Command):
31  """No-op command."""
32 
33  description = ''
34  user_options = []
35 
36  def initialize_options(self):
37  pass
38 
39  def finalize_options(self):
40  pass
41 
42  def run(self):
43  pass
44 
45 
46 CLASSIFIERS = [
47  'Development Status :: 5 - Production/Stable',
48  'Programming Language :: Python',
49  'Programming Language :: Python :: 3',
50  'Programming Language :: Python :: 3.4',
51  'Programming Language :: Python :: 3.5',
52  'Programming Language :: Python :: 3.6',
53  'Programming Language :: Python :: 3.7',
54  'Programming Language :: Python :: 3.8',
55  'Programming Language :: Python :: 3.9',
56  'Programming Language :: Python :: 3.10',
57  'License :: OSI Approved :: Apache Software License',
58 ]
59 
60 PACKAGE_DIRECTORIES = {
61  '': '.',
62 }
63 
64 INSTALL_REQUIRES = (
65  'protobuf>=3.12.0',
66  'grpcio>={version}'.format(version=grpc_version.VERSION),
67  'googleapis-common-protos>=1.5.5',
68 )
69 
70 try:
71  import status_commands as _status_commands
72 
73  # we are in the build environment, otherwise the above import fails
74  COMMAND_CLASS = {
75  # Run preprocess from the repository *before* doing any packaging!
76  'preprocess': _status_commands.Preprocess,
77  'build_package_protos': _NoOpCommand,
78  }
79 except ImportError:
80  COMMAND_CLASS = {
81  # wire up commands to no-op not to break the external dependencies
82  'preprocess': _NoOpCommand,
83  'build_package_protos': _NoOpCommand,
84  }
85 
86 setuptools.setup(name='grpcio-status',
87  version=grpc_version.VERSION,
88  description='Status proto mapping for gRPC',
89  long_description=open(_README_PATH, 'r').read(),
90  author='The gRPC Authors',
91  author_email='grpc-io@googlegroups.com',
92  url='https://grpc.io',
93  license='Apache License 2.0',
94  classifiers=CLASSIFIERS,
95  package_dir=PACKAGE_DIRECTORIES,
96  packages=setuptools.find_packages('.'),
97  python_requires='>=3.6',
98  install_requires=INSTALL_REQUIRES,
99  cmdclass=COMMAND_CLASS)
setup._NoOpCommand.finalize_options
def finalize_options(self)
Definition: src/python/grpcio_channelz/setup.py:40
http2_test_server.format
format
Definition: http2_test_server.py:118
setup._NoOpCommand.run
def run(self)
Definition: src/python/grpcio_channelz/setup.py:43
read
int read(izstream &zs, T *x, Items items)
Definition: bloaty/third_party/zlib/contrib/iostream2/zstream.h:115
setup._NoOpCommand.initialize_options
def initialize_options(self)
Definition: src/python/grpcio_channelz/setup.py:37
open
#define open
Definition: test-fs.c:46


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:18