aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_reflection
diff options
context:
space:
mode:
authorGravatar Lidi Zheng <lidiz@google.com>2018-12-05 14:51:07 -0800
committerGravatar Lidi Zheng <lidiz@google.com>2018-12-05 15:25:48 -0800
commit5584d58e6ce3dbc2f110f1096dfd739b1cb2ce18 (patch)
tree448346fa1eefb865ad9c3bc90921347e58d5f3dd /src/python/grpcio_reflection
parent8d438057e42864e0a53217cd7b8d1636d5842422 (diff)
Add LICENSE to grpcio-* packages
* Using the proprocess command to copy the LICENSE
Diffstat (limited to 'src/python/grpcio_reflection')
-rw-r--r--src/python/grpcio_reflection/MANIFEST.in1
-rw-r--r--src/python/grpcio_reflection/reflection_commands.py8
-rw-r--r--src/python/grpcio_reflection/setup.py2
3 files changed, 8 insertions, 3 deletions
diff --git a/src/python/grpcio_reflection/MANIFEST.in b/src/python/grpcio_reflection/MANIFEST.in
index d6fb6ce73a..10b01fa41d 100644
--- a/src/python/grpcio_reflection/MANIFEST.in
+++ b/src/python/grpcio_reflection/MANIFEST.in
@@ -1,3 +1,4 @@
include grpc_version.py
recursive-include grpc_reflection *.py
global-exclude *.pyc
+include LICENSE
diff --git a/src/python/grpcio_reflection/reflection_commands.py b/src/python/grpcio_reflection/reflection_commands.py
index 6f91f6b875..311ca4c4db 100644
--- a/src/python/grpcio_reflection/reflection_commands.py
+++ b/src/python/grpcio_reflection/reflection_commands.py
@@ -21,10 +21,12 @@ import setuptools
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
REFLECTION_PROTO = os.path.join(
ROOT_DIR, '../../proto/grpc/reflection/v1alpha/reflection.proto')
+LICENSE = os.path.join(ROOT_DIR, '../../../LICENSE')
-class CopyProtoModules(setuptools.Command):
- """Command to copy proto modules from grpc/src/proto."""
+class Preprocess(setuptools.Command):
+ """Command to copy proto modules from grpc/src/proto and LICENSE from
+ the root directory"""
description = ''
user_options = []
@@ -41,6 +43,8 @@ class CopyProtoModules(setuptools.Command):
REFLECTION_PROTO,
os.path.join(ROOT_DIR,
'grpc_reflection/v1alpha/reflection.proto'))
+ if os.path.isfile(LICENSE):
+ shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE'))
class BuildPackageProtos(setuptools.Command):
diff --git a/src/python/grpcio_reflection/setup.py b/src/python/grpcio_reflection/setup.py
index b4087d87b4..f205069acd 100644
--- a/src/python/grpcio_reflection/setup.py
+++ b/src/python/grpcio_reflection/setup.py
@@ -69,7 +69,7 @@ try:
'grpcio-tools=={version}'.format(version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
- 'preprocess': _reflection_commands.CopyProtoModules,
+ 'preprocess': _reflection_commands.Preprocess,
'build_package_protos': _reflection_commands.BuildPackageProtos,
}
except ImportError: