Merge pull request #17411 from lidizheng/add-license

Add License to Python tarball
reviewable/pr17291/r6
Lidi Zheng 6 years ago committed by GitHub
commit 64fc25f38c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      PYTHON-MANIFEST.in
  2. 3
      setup.cfg
  3. 1
      src/python/grpcio_channelz/MANIFEST.in
  4. 8
      src/python/grpcio_channelz/channelz_commands.py
  5. 2
      src/python/grpcio_channelz/setup.py
  6. 1
      src/python/grpcio_health_checking/MANIFEST.in
  7. 8
      src/python/grpcio_health_checking/health_commands.py
  8. 2
      src/python/grpcio_health_checking/setup.py
  9. 1
      src/python/grpcio_reflection/MANIFEST.in
  10. 8
      src/python/grpcio_reflection/reflection_commands.py
  11. 2
      src/python/grpcio_reflection/setup.py
  12. 1
      src/python/grpcio_testing/MANIFEST.in
  13. 33
      src/python/grpcio_testing/setup.py
  14. 39
      src/python/grpcio_testing/testing_commands.py
  15. 3
      tools/run_tests/artifacts/build_artifact_python.sh

@ -20,3 +20,4 @@ include src/python/grpcio/README.rst
include requirements.txt
include etc/roots.pem
include Makefile
include LICENSE

@ -15,3 +15,6 @@ exclude=.*protoc_plugin/protoc_plugin_test\.proto$
# Style settings
[yapf]
based_on_style = google
[metadata]
license_files = LICENSE

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

@ -21,10 +21,12 @@ import setuptools
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
CHANNELZ_PROTO = os.path.join(ROOT_DIR,
'../../proto/grpc/channelz/channelz.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 = []
@ -40,6 +42,8 @@ class CopyProtoModules(setuptools.Command):
shutil.copyfile(CHANNELZ_PROTO,
os.path.join(ROOT_DIR,
'grpc_channelz/v1/channelz.proto'))
if os.path.isfile(LICENSE):
shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE'))
class BuildPackageProtos(setuptools.Command):

@ -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': _channelz_commands.CopyProtoModules,
'preprocess': _channelz_commands.Preprocess,
'build_package_protos': _channelz_commands.BuildPackageProtos,
}
except ImportError:

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

@ -20,10 +20,12 @@ import setuptools
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
HEALTH_PROTO = os.path.join(ROOT_DIR, '../../proto/grpc/health/v1/health.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 = []
@ -39,6 +41,8 @@ class CopyProtoModules(setuptools.Command):
shutil.copyfile(HEALTH_PROTO,
os.path.join(ROOT_DIR,
'grpc_health/v1/health.proto'))
if os.path.isfile(LICENSE):
shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE'))
class BuildPackageProtos(setuptools.Command):

@ -68,7 +68,7 @@ try:
'grpcio-tools=={version}'.format(version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': _health_commands.CopyProtoModules,
'preprocess': _health_commands.Preprocess,
'build_package_protos': _health_commands.BuildPackageProtos,
}
except ImportError:

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

@ -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):

@ -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:

@ -1,3 +1,4 @@
include grpc_version.py
recursive-include grpc_testing *.py
global-exclude *.pyc
include LICENSE

@ -24,6 +24,23 @@ os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Break import style to ensure that we can find same-directory modules.
import grpc_version
class _NoOpCommand(setuptools.Command):
"""No-op command."""
description = ''
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass
PACKAGE_DIRECTORIES = {
'': '.',
}
@ -33,6 +50,19 @@ INSTALL_REQUIRES = (
'grpcio>={version}'.format(version=grpc_version.VERSION),
)
try:
import testing_commands as _testing_commands
# we are in the build environment, otherwise the above import fails
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': _testing_commands.Preprocess,
}
except ImportError:
COMMAND_CLASS = {
# wire up commands to no-op not to break the external dependencies
'preprocess': _NoOpCommand,
}
setuptools.setup(
name='grpcio-testing',
version=grpc_version.VERSION,
@ -43,4 +73,5 @@ setuptools.setup(
url='https://grpc.io',
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
install_requires=INSTALL_REQUIRES)
install_requires=INSTALL_REQUIRES,
cmdclass=COMMAND_CLASS)

@ -0,0 +1,39 @@
# Copyright 2018 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.
"""Provides distutils command classes for the GRPC Python setup process."""
import os
import shutil
import setuptools
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
LICENSE = os.path.join(ROOT_DIR, '../../../LICENSE')
class Preprocess(setuptools.Command):
"""Command to copy LICENSE from root directory."""
description = ''
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if os.path.isfile(LICENSE):
shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE'))

@ -105,7 +105,8 @@ then
"${PIP}" install grpcio-tools --no-index --find-links "file://$ARTIFACT_DIR/"
# Build grpcio_testing source distribution
${SETARCH_CMD} "${PYTHON}" src/python/grpcio_testing/setup.py sdist
${SETARCH_CMD} "${PYTHON}" src/python/grpcio_testing/setup.py preprocess \
sdist
cp -r src/python/grpcio_testing/dist/* "$ARTIFACT_DIR"
# Build grpcio_channelz source distribution

Loading…
Cancel
Save