From 0cd9cbcf60350854d5510d4cfa5229d622882d63 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 10 Feb 2016 20:16:34 +0100 Subject: [PATCH 01/24] Fixing the absence of 'tag' in the version. --- tools/buildgen/plugins/expand_version.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py index a103618c01a..b55e1b15ff8 100755 --- a/tools/buildgen/plugins/expand_version.py +++ b/tools/buildgen/plugins/expand_version.py @@ -51,6 +51,7 @@ LANGUAGES = [ class Version: def __init__(self, s): + self.tag = None if '-' in s: s, self.tag = s.split('-') self.major, self.minor, self.patch = [int(x) for x in s.split('.')] @@ -78,7 +79,10 @@ class Version: def ruby(self): """Version string in Ruby style""" - return '%d.%d.%d.%s' % (self.major, self.minor, self.patch, self.tag) + if self.tag: + return '%d.%d.%d.%s' % (self.major, self.minor, self.patch, self.tag) + else: + return '%d.%d.%d' % (self.major, self.minor, self.patch) def mako_plugin(dictionary): """Expand version numbers: From 334e9e6fa205eb3f8ebb798d47444856bf973a9d Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Wed, 10 Feb 2016 20:12:59 -0800 Subject: [PATCH 02/24] Use wheels instead for custom bdists --- requirements.txt | 1 + setup.py | 2 +- src/python/grpcio/commands.py | 88 ++++++++++++------------ tools/run_tests/build_artifact_python.sh | 2 +- 4 files changed, 46 insertions(+), 47 deletions(-) diff --git a/requirements.txt b/requirements.txt index a1cc88cfe73..e3208e63556 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ futures>=2.2.0 cython>=0.23 coverage>=4.0 six>=1.10 +wheel>=0.29 diff --git a/setup.py b/setup.py index f8450a7677f..7da070ef0f5 100644 --- a/setup.py +++ b/setup.py @@ -164,7 +164,7 @@ COMMAND_CLASS = { 'build_ext': commands.BuildExt, 'gather': commands.Gather, 'run_interop': commands.RunInterop, - 'bdist_egg_grpc_custom': commands.BdistEggCustomName, + 'bdist_wheel_grpc_custom': commands.BdistWheelCustomName, } # Ensure that package data is copied over before any commands have been run: diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 774e7ad6a1c..1561bbf05ed 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -41,12 +41,12 @@ import sys import traceback import setuptools -from setuptools.command import bdist_egg from setuptools.command import build_ext from setuptools.command import build_py from setuptools.command import easy_install from setuptools.command import install from setuptools.command import test +from wheel import bdist_wheel import support @@ -59,6 +59,8 @@ BINARIES_REPOSITORY = os.environ.get( USE_GRPC_CUSTOM_BDIST = bool(int(os.environ.get( 'GRPC_PYTHON_USE_CUSTOM_BDIST', '1'))) +GRPC_CUSTOM_BDIST_EXT = '.whl' + CONF_PY_ADDENDUM = """ extensions.append('sphinx.ext.napoleon') napoleon_google_docstring = True @@ -74,46 +76,52 @@ class CommandError(Exception): # TODO(atash): Remove this once PyPI has better Linux bdist support. See # https://bitbucket.org/pypa/pypi/issues/120/binary-wheels-for-linux-are-not-supported -def _get_grpc_custom_bdist_egg(decorated_basename, target_egg_basename): - """Returns a string path to a .egg file for Linux to install. +def _get_grpc_custom_bdist(decorated_basename, target_bdist_basename): + """Returns a string path to a bdist file for Linux to install. - If we can retrieve a pre-compiled egg from online, uses it. Else, emits a + If we can retrieve a pre-compiled bdist from online, uses it. Else, emits a warning and builds from source. """ + # TODO(atash): somehow the name that's returned from `wheel` is different + # between different versions of 'wheel' (but from a compatibility standpoint, + # the names are compatible); we should have some way of determining name + # compatibility in the same way `wheel` does to avoid having to rename all of + # the custom wheels that we build/upload to GCS. + # Break import style to ensure that setup.py has had a chance to install the - # relevant package eggs. + # relevant package. from six.moves.urllib import request - decorated_path = decorated_basename + '.egg' + decorated_path = decorated_basename + GRPC_CUSTOM_BDIST_EXT try: url = BINARIES_REPOSITORY + '/{target}'.format(target=decorated_path) - egg_data = request.urlopen(url).read() + bdist_data = request.urlopen(url).read() except IOError as error: raise CommandError( - '{}\n\nCould not find the bdist egg {}: {}' + '{}\n\nCould not find the bdist {}: {}' .format(traceback.format_exc(), decorated_path, error.message)) - # Our chosen local egg path. - egg_path = target_egg_basename + '.egg' + # Our chosen local bdist path. + bdist_path = target_bdist_basename + GRPC_CUSTOM_BDIST_EXT try: - with open(egg_path, 'w') as egg_file: - egg_file.write(egg_data) + with open(bdist_path, 'w') as bdist_file: + bdist_file.write(bdist_data) except IOError as error: raise CommandError( - '{}\n\nCould not write grpcio egg: {}' + '{}\n\nCould not write grpcio bdist: {}' .format(traceback.format_exc(), error.message)) - return egg_path + return bdist_path -class EggNameMixin(object): - """Mixin for setuptools.Command classes to enable acquiring the egg name.""" +class WheelNameMixin(object): + """Mixin for setuptools.Command classes to enable acquiring the bdist name.""" - def egg_name(self, with_custom): + def wheel_name(self, with_custom): """ Args: - with_custom: Boolean describing whether or not to decorate the egg name + with_custom: Boolean describing whether or not to decorate the bdist name with custom gRPC-specific target information. """ - egg_command = self.get_finalized_command('bdist_egg') - base = os.path.splitext(os.path.basename(egg_command.egg_output))[0] + wheel_command = self.get_finalized_command('bdist_wheel') + base = wheel_command.get_archive_basename() if with_custom: flavor = 'ucs2' if sys.maxunicode == 65535 else 'ucs4' return '{base}-{flavor}'.format(base=base, flavor=flavor) @@ -121,7 +129,7 @@ class EggNameMixin(object): return base -class Install(install.install, EggNameMixin): +class Install(install.install, WheelNameMixin): """Custom Install command for gRPC Python. This is for bdist shims and whatever else we might need a custom install @@ -147,15 +155,15 @@ class Install(install.install, EggNameMixin): if self.use_grpc_custom_bdist: try: try: - egg_path = _get_grpc_custom_bdist_egg(self.egg_name(True), - self.egg_name(False)) + bdist_path = _get_grpc_custom_bdist(self.wheel_name(True), + self.wheel_name(False)) except CommandError as error: sys.stderr.write( '\nWARNING: Failed to acquire grpcio prebuilt binary:\n' '{}.\n\n'.format(error.message)) raise try: - self._run_bdist_retrieval_install(egg_path) + self._run_bdist_retrieval_install(bdist_path) except Exception as error: # if anything else happens (and given how there's no way to really know # what's happening in setuptools here, I mean *anything*), warn the user @@ -171,29 +179,19 @@ class Install(install.install, EggNameMixin): # TODO(atash): Remove this once PyPI has better Linux bdist support. See # https://bitbucket.org/pypa/pypi/issues/120/binary-wheels-for-linux-are-not-supported - def _run_bdist_retrieval_install(self, bdist_egg): - easy_install = self.distribution.get_command_class('easy_install') - easy_install_command = easy_install( - self.distribution, args='x', root=self.root, record=self.record, - ) - easy_install_command.ensure_finalized() - easy_install_command.always_copy_from = '.' - easy_install_command.package_index.scan(glob.glob('*.egg')) - arguments = [bdist_egg] - if setuptools.bootstrap_install_from: - args.insert(0, setuptools.bootstrap_install_from) - easy_install_command.args = arguments - easy_install_command.run() - setuptools.bootstrap_install_from = None - - -class BdistEggCustomName(bdist_egg.bdist_egg, EggNameMixin): - """Thin wrapper around the bdist_egg command to build with our custom name.""" + def _run_bdist_retrieval_install(self, bdist_path): + import pip + pip.main(['install', bdist_path]) + + +class BdistWheelCustomName(bdist_wheel.bdist_wheel, WheelNameMixin): + """Thin wrapper around the bdist command to build with our custom name.""" def run(self): - bdist_egg.bdist_egg.run(self) - target = os.path.join(self.dist_dir, '{}.egg'.format(self.egg_name(True))) - shutil.move(self.get_outputs()[0], target) + bdist_wheel.bdist_wheel.run(self) + output = self.distribution.dist_files[-1][2] + target = os.path.join(self.dist_dir, '{}.whl'.format(self.wheel_name(True))) + shutil.move(output, target) class SphinxDocumentation(setuptools.Command): diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/build_artifact_python.sh index 835fad83e14..f22ddd9185f 100755 --- a/tools/run_tests/build_artifact_python.sh +++ b/tools/run_tests/build_artifact_python.sh @@ -44,7 +44,7 @@ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ ${SETARCH_CMD} python setup.py \ bdist_wheel \ sdist \ - bdist_egg_grpc_custom + bdist_wheel_grpc_custom mkdir -p artifacts From ab604b6d76e84c87eb196b6db9d2b12018485a7b Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 11 Feb 2016 12:59:37 -0800 Subject: [PATCH 03/24] Bundle node-pre-gyp with the node package --- package.json | 5 ++--- templates/package.json.template | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fe364d37a43..df976fd3a56 100644 --- a/package.json +++ b/package.json @@ -23,13 +23,12 @@ "test": "./node_modules/.bin/mocha src/node/test && npm run-script lint", "gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test", - "preinstall": "npm install node-pre-gyp", - "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build" + "install": "node-pre-gyp install --fallback-to-build" }, + "bundledDependencies": ["node-pre-gyp"], "dependencies": { "lodash": "^3.9.3", "nan": "^2.0.0", - "node-pre-gyp": "^0.6.19", "protobufjs": "^4.0.0" }, "devDependencies": { diff --git a/templates/package.json.template b/templates/package.json.template index d6279b996e9..ba2a078bb2f 100644 --- a/templates/package.json.template +++ b/templates/package.json.template @@ -25,13 +25,12 @@ "test": "./node_modules/.bin/mocha src/node/test && npm run-script lint", "gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test", - "preinstall": "npm install node-pre-gyp", - "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build" + "install": "node-pre-gyp install --fallback-to-build" }, + "bundledDependencies": ["node-pre-gyp"], "dependencies": { "lodash": "^3.9.3", "nan": "^2.0.0", - "node-pre-gyp": "^0.6.19", "protobufjs": "^4.0.0" }, "devDependencies": { From b6d3a8238d58730472a14524ecd06ad94550a48b Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Thu, 11 Feb 2016 13:08:14 -0800 Subject: [PATCH 04/24] Paper over custom command limitations The custom gRPC bdist command depends on numerous undocumented and private behaviors of setuptools, wheel, distutils, etc. One such is the ordering of generated distribution targets. We paper over this under the assumption that the command will only be useful for gRPC devs, and document with a command description a contractual obligation of users of the command. --- src/python/grpcio/commands.py | 10 ++++++++++ tools/run_tests/build_artifact_python.sh | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 1561bbf05ed..eb5cbb34f08 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -187,7 +187,17 @@ class Install(install.install, WheelNameMixin): class BdistWheelCustomName(bdist_wheel.bdist_wheel, WheelNameMixin): """Thin wrapper around the bdist command to build with our custom name.""" + description = ("Create a gRPC custom-named wheel distribution. " + "Cannot be run with any other distribution-related command.") + def run(self): + # TODO(atash): if the hack we use to support Linux binaries becomes + # 'supported' (i.e. + # https://bitbucket.org/pypa/pypi/issues/120/binary-wheels-for-linux-are-not-supported + # is not solved and we see users beginning to use this command, ill-advised + # as that may be) consider making the following capable of running with + # other distribution-related commands. Currently it depends on the (AFAIK + # undocumented, private) ordering of the distribution files. bdist_wheel.bdist_wheel.run(self) output = self.distribution.dist_files[-1][2] target = os.path.join(self.dist_dir, '{}.whl'.format(self.wheel_name(True))) diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/build_artifact_python.sh index f22ddd9185f..f2c10aba7b1 100755 --- a/tools/run_tests/build_artifact_python.sh +++ b/tools/run_tests/build_artifact_python.sh @@ -43,7 +43,13 @@ GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ ${SETARCH_CMD} python setup.py \ bdist_wheel \ - sdist \ + sdist + +# The bdist_wheel_grpc_custom command is finicky about command output ordering +# and thus ought to be run in a shell command separate of others. +GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ +GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ +${SETARCH_CMD} python setup.py \ bdist_wheel_grpc_custom mkdir -p artifacts From 96aec2d3212ac9cfba88e0e5c066977a4ca0dbb5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 8 Feb 2016 15:42:59 -0800 Subject: [PATCH 05/24] fix python centos6 distribtest --- .../distribtest/python_centos6_x64/Dockerfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile index 99306bb4037..79dae0742f2 100644 --- a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile @@ -29,10 +29,18 @@ FROM centos:6 -RUN yum install -y python +RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm -RUN rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm -RUN yum install -y python-pip +# Vanilla CentOS6 only has python 2.6 and we don't support that. +RUN yum -y install yum -y install https://centos6.iuscommunity.org/ius-release.rpm +RUN yum install -y python27 -RUN pip install --upgrade pip +# Override python2.6 +RUN ln -s /usr/bin/python2.7 /usr/local/bin/python +RUN ln -s /usr/bin/python2.7 /usr/local/bin/python2 +# Install pip +RUN curl https://bootstrap.pypa.io/get-pip.py | python - + +# "which" command required by python's run_distrib_test.sh +RUN yum install -y which From 2bbffcf18f62eb4d56082780220312f352a2a678 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Thu, 11 Feb 2016 14:58:59 -0800 Subject: [PATCH 06/24] Reorder Python artifact commands --- tools/run_tests/build_artifact_python.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/build_artifact_python.sh index f2c10aba7b1..5768485ca2a 100755 --- a/tools/run_tests/build_artifact_python.sh +++ b/tools/run_tests/build_artifact_python.sh @@ -39,18 +39,20 @@ then pip install -rrequirements.txt fi +# The bdist_wheel_grpc_custom command is finicky about command output ordering +# and thus ought to be run in a shell command separate of others. Further, it +# trashes the actual bdist_wheel output, so it should be run first so that +# bdist_wheel may be run unmolested. GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ ${SETARCH_CMD} python setup.py \ - bdist_wheel \ - sdist + bdist_wheel_grpc_custom -# The bdist_wheel_grpc_custom command is finicky about command output ordering -# and thus ought to be run in a shell command separate of others. GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ ${SETARCH_CMD} python setup.py \ - bdist_wheel_grpc_custom + bdist_wheel \ + sdist mkdir -p artifacts From c1e86744c677fffc35a924e4ff6906a0f98e712a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 11 Feb 2016 17:03:49 -0800 Subject: [PATCH 07/24] fix fedora21 distribtests --- tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile | 5 +++++ tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile index b44fcff7e31..1eb4c1e7750 100644 --- a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile @@ -29,4 +29,9 @@ FROM fedora:21 +# Make yum work properly under docker when using overlay storage driver. +# https://bugzilla.redhat.com/show_bug.cgi?id=1213602#c9 +# https://github.com/docker/docker/issues/10180 +RUN yum install -y yum-plugin-ovl + RUN yum clean all && yum update -y && yum install -y python python-pip diff --git a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile index 598dac5a112..b567c5b1092 100644 --- a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile +++ b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile @@ -29,6 +29,11 @@ FROM fedora:21 +# Make yum work properly under docker when using overlay storage driver. +# https://bugzilla.redhat.com/show_bug.cgi?id=1213602#c9 +# https://github.com/docker/docker/issues/10180 +RUN yum install -y yum-plugin-ovl + RUN yum clean all && yum update -y && yum install -y ruby RUN gem install bundler From 802393b54957fde800d35d07d2005258defcf89e Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 11 Feb 2016 17:23:15 -0800 Subject: [PATCH 08/24] Fix node distrib test on Debian Jessie x86 --- tools/run_tests/distribtest_targets.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py index b26a8707781..8b7c86d69b0 100644 --- a/tools/run_tests/distribtest_targets.py +++ b/tools/run_tests/distribtest_targets.py @@ -122,11 +122,15 @@ class NodeDistribTest(object): def build_jobspec(self): if self.platform == 'linux': + linux32 = '' + if self.arch == 'x86': + linux32 = 'linux32' return create_docker_jobspec(self.name, 'tools/dockerfile/distribtest/node_%s_%s' % ( self.docker_suffix, self.arch), - 'test/distrib/node/run_distrib_test.sh %s' % ( + '%s test/distrib/node/run_distrib_test.sh %s' % ( + linux32, self.node_version)) elif self.platform == 'macos': return create_jobspec(self.name, From 32f64d580a43f1165c5239ed2e67b423ab3cb96c Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 11 Feb 2016 18:14:50 -0800 Subject: [PATCH 09/24] Disable Node Mac 0.10 distrib test --- tools/run_tests/distribtest_targets.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py index 8b7c86d69b0..fe26fd51b8b 100644 --- a/tools/run_tests/distribtest_targets.py +++ b/tools/run_tests/distribtest_targets.py @@ -240,7 +240,6 @@ def targets(): RubyDistribTest('linux', 'x64', 'ubuntu1504'), RubyDistribTest('linux', 'x64', 'ubuntu1510'), RubyDistribTest('linux', 'x64', 'ubuntu1604'), - NodeDistribTest('macos', 'x64', None, '0.10'), NodeDistribTest('macos', 'x64', None, '0.12'), NodeDistribTest('macos', 'x64', None, '3'), NodeDistribTest('macos', 'x64', None, '4'), From 71b42cde466442b8cbc9eb3d73ae15d1d54f1446 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 11 Feb 2016 18:15:56 -0800 Subject: [PATCH 10/24] Ensure that node-pre-gyp is properly bundled --- tools/run_tests/build_package_node.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/run_tests/build_package_node.sh b/tools/run_tests/build_package_node.sh index a8b9448973f..aca90a37500 100755 --- a/tools/run_tests/build_package_node.sh +++ b/tools/run_tests/build_package_node.sh @@ -38,6 +38,7 @@ cd $(dirname $0)/../.. mkdir -p artifacts/ cp -r $EXTERNAL_GIT_ROOT/architecture={x86,x64},language=node,platform={windows,linux,macos}/artifacts/* artifacts/ || true +npm update npm pack cp grpc-*.tgz artifacts/grpc.tgz From dd6ee7af7e67a7b0644f0c40468c88fef6eb2626 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Thu, 11 Feb 2016 20:08:49 -0800 Subject: [PATCH 11/24] Truncate Python target triple --- src/python/grpcio/commands.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index eb5cbb34f08..58af6bebf56 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -114,19 +114,17 @@ def _get_grpc_custom_bdist(decorated_basename, target_bdist_basename): class WheelNameMixin(object): """Mixin for setuptools.Command classes to enable acquiring the bdist name.""" - def wheel_name(self, with_custom): - """ - Args: - with_custom: Boolean describing whether or not to decorate the bdist name - with custom gRPC-specific target information. - """ + def wheel_custom_name(self): + base = self.wheel_name() + # Drop troublesome parts of the target tuple + base_split = base.split('-') + base = '-'.join(base_split[0:3] + base_split[4:]) + flavor = 'ucs2' if sys.maxunicode == 65535 else 'ucs4' + return '{base}-{flavor}'.format(base=base, flavor=flavor) + + def wheel_name(self): wheel_command = self.get_finalized_command('bdist_wheel') - base = wheel_command.get_archive_basename() - if with_custom: - flavor = 'ucs2' if sys.maxunicode == 65535 else 'ucs4' - return '{base}-{flavor}'.format(base=base, flavor=flavor) - else: - return base + return wheel_command.get_archive_basename() class Install(install.install, WheelNameMixin): @@ -155,8 +153,8 @@ class Install(install.install, WheelNameMixin): if self.use_grpc_custom_bdist: try: try: - bdist_path = _get_grpc_custom_bdist(self.wheel_name(True), - self.wheel_name(False)) + bdist_path = _get_grpc_custom_bdist(self.wheel_custom_name(), + self.wheel_name()) except CommandError as error: sys.stderr.write( '\nWARNING: Failed to acquire grpcio prebuilt binary:\n' @@ -200,7 +198,8 @@ class BdistWheelCustomName(bdist_wheel.bdist_wheel, WheelNameMixin): # undocumented, private) ordering of the distribution files. bdist_wheel.bdist_wheel.run(self) output = self.distribution.dist_files[-1][2] - target = os.path.join(self.dist_dir, '{}.whl'.format(self.wheel_name(True))) + target = os.path.join( + self.dist_dir, '{}.whl'.format(self.wheel_custom_name())) shutil.move(output, target) From cd4358460d156b627f1fc47fe055ae80394eb9ce Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Thu, 11 Feb 2016 20:12:48 -0800 Subject: [PATCH 12/24] Bump Python version --- build.yaml | 1 + src/python/grpcio/grpc_version.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.yaml b/build.yaml index 0aaef67cacb..e99c70619bc 100644 --- a/build.yaml +++ b/build.yaml @@ -7,6 +7,7 @@ settings: '#3': Use "-preN" suffixes to identify pre-release versions '#4': Per-language overrides are possible with (eg) ruby_version tag here '#5': See the expand_version.py for all the quirks here + python_version: 0.13.0-pre2 ruby_version: 0.13.0-pre1.1 version: 0.13.0-pre1 filegroups: diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index b256871bd5e..c1cf33d1b11 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='0.13.0rc1' +VERSION='0.13.0rc2' From b14ea1de58b6ecc7105c59d84b6efd59bd2b89e0 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Thu, 11 Feb 2016 20:33:07 -0800 Subject: [PATCH 13/24] Revert Ruby version specialization --- build.yaml | 1 - src/ruby/lib/grpc/version.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build.yaml b/build.yaml index e99c70619bc..707743557cd 100644 --- a/build.yaml +++ b/build.yaml @@ -8,7 +8,6 @@ settings: '#4': Per-language overrides are possible with (eg) ruby_version tag here '#5': See the expand_version.py for all the quirks here python_version: 0.13.0-pre2 - ruby_version: 0.13.0-pre1.1 version: 0.13.0-pre1 filegroups: - name: census diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 992991d8e19..d7aa18be3e2 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '0.13.0.pre1.1' + VERSION = '0.13.0.pre1' end From 7ca0dcc843cd081252f1c5f6af4c244b66f9196e Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Feb 2016 09:34:11 -0800 Subject: [PATCH 14/24] Don't have artifact build depend on global node-pre-gyp --- tools/run_tests/build_artifact_node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/build_artifact_node.sh b/tools/run_tests/build_artifact_node.sh index 9a3b9bd1baf..1467dddc35e 100755 --- a/tools/run_tests/build_artifact_node.sh +++ b/tools/run_tests/build_artifact_node.sh @@ -46,6 +46,6 @@ node_versions=( 0.12.0 1.0.0 1.1.0 2.0.0 3.0.0 4.0.0 5.0.0 ) for version in ${node_versions[@]} do - node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH + ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH cp -r build/stage/* artifacts/ done From 166214f9f6724ea1b1f898822b60208a36f50fcb Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Feb 2016 09:56:14 -0800 Subject: [PATCH 15/24] Don't fail distrib test if a static server is running --- test/distrib/node/run_distrib_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/distrib/node/run_distrib_test.sh b/test/distrib/node/run_distrib_test.sh index 99a51f01f76..9b8f15771b8 100755 --- a/test/distrib/node/run_distrib_test.sh +++ b/test/distrib/node/run_distrib_test.sh @@ -38,6 +38,9 @@ nvm install $NODE_VERSION npm install -g node-static +# Kill off existing static servers +kill -9 $(ps aux | grep '[n]ode .*static' | awk '{print $2}') || true + STATIC_SERVER=127.0.0.1 STATIC_PORT=8080 From 35f07fc9313d6a2fef94647559ca1192bca36f8c Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Feb 2016 12:57:20 -0800 Subject: [PATCH 16/24] Properly handle rm -rf result on Mac --- tools/run_tests/build_artifact_node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/build_artifact_node.sh b/tools/run_tests/build_artifact_node.sh index 1467dddc35e..6aa48245383 100755 --- a/tools/run_tests/build_artifact_node.sh +++ b/tools/run_tests/build_artifact_node.sh @@ -36,7 +36,7 @@ nvm use 4 cd $(dirname $0)/../.. -rm -rf build +rm -rf build || true mkdir -p artifacts From 9ab6d0c42537afec7ce22b70d4eedcafe8752c77 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Feb 2016 13:36:39 -0800 Subject: [PATCH 17/24] Ensure we use local node-pre-gyp in Node install hook --- package.json | 2 +- templates/package.json.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index df976fd3a56..b3888afde75 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "test": "./node_modules/.bin/mocha src/node/test && npm run-script lint", "gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test", - "install": "node-pre-gyp install --fallback-to-build" + "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build" }, "bundledDependencies": ["node-pre-gyp"], "dependencies": { diff --git a/templates/package.json.template b/templates/package.json.template index ba2a078bb2f..99e8287b357 100644 --- a/templates/package.json.template +++ b/templates/package.json.template @@ -25,7 +25,7 @@ "test": "./node_modules/.bin/mocha src/node/test && npm run-script lint", "gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test", - "install": "node-pre-gyp install --fallback-to-build" + "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build" }, "bundledDependencies": ["node-pre-gyp"], "dependencies": { From f747409f6f528c95f39297ebf3aea02085119285 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Fri, 12 Feb 2016 12:04:53 -0800 Subject: [PATCH 18/24] Use precompiled extensions only --- PYTHON-MANIFEST.in | 1 + setup.py | 42 ++++++---- src/python/grpcio/commands.py | 102 ----------------------- src/python/grpcio/precompiled.py | 102 +++++++++++++++++++++++ tools/run_tests/build_artifact_python.sh | 2 +- 5 files changed, 128 insertions(+), 121 deletions(-) create mode 100644 src/python/grpcio/precompiled.py diff --git a/PYTHON-MANIFEST.in b/PYTHON-MANIFEST.in index 3c46d611702..072089ac51f 100644 --- a/PYTHON-MANIFEST.in +++ b/PYTHON-MANIFEST.in @@ -7,6 +7,7 @@ graft third_party/zlib include src/python/grpcio/commands.py include src/python/grpcio/grpc_version.py include src/python/grpcio/grpc_core_dependencies.py +include src/python/grpcio/precompiled.py include src/python/grpcio/support.py include src/python/grpcio/README.rst include requirements.txt diff --git a/setup.py b/setup.py index 7da070ef0f5..135c8188850 100644 --- a/setup.py +++ b/setup.py @@ -53,6 +53,7 @@ sys.path.insert(0, os.path.abspath(PYTHON_STEM)) # Break import-style to ensure we can actually find our in-repo dependencies. import commands +import precompiled import grpc_core_dependencies import grpc_version @@ -156,15 +157,14 @@ SETUP_REQUIRES = ( ) + INSTALL_REQUIRES COMMAND_CLASS = { - 'install': commands.Install, 'doc': commands.SphinxDocumentation, 'build_proto_modules': commands.BuildProtoModules, 'build_project_metadata': commands.BuildProjectMetadata, 'build_py': commands.BuildPy, 'build_ext': commands.BuildExt, + 'build_tagged_ext': precompiled.BuildTaggedExt, 'gather': commands.Gather, 'run_interop': commands.RunInterop, - 'bdist_wheel_grpc_custom': commands.BdistWheelCustomName, } # Ensure that package data is copied over before any commands have been run: @@ -205,9 +205,12 @@ PACKAGE_DATA = { 'grpc._adapter': [ 'credentials/roots.pem' ], + # Binaries that may or may not be present in the final installation, but are + # mentioned here for completeness. 'grpc._cython': [ '_windows/grpc_c.32.python', '_windows/grpc_c.64.python', + 'cygrpc.so', ], } if INSTALL_TESTS: @@ -217,19 +220,22 @@ else: PACKAGES = setuptools.find_packages( PYTHON_STEM, exclude=['tests', 'tests.*']) -setuptools.setup( - name='grpcio', - version=grpc_version.VERSION, - license=LICENSE, - ext_modules=CYTHON_EXTENSION_MODULES, - packages=list(PACKAGES), - package_dir=PACKAGE_DIRECTORIES, - package_data=PACKAGE_DATA, - install_requires=INSTALL_REQUIRES, - setup_requires=SETUP_REQUIRES, - cmdclass=COMMAND_CLASS, - tests_require=TESTS_REQUIRE, - test_suite=TEST_SUITE, - test_loader=TEST_LOADER, - test_runner=TEST_RUNNER, -) +setup_arguments = { + 'name': 'grpcio', + 'version': grpc_version.VERSION, + 'license': LICENSE, + 'ext_modules': CYTHON_EXTENSION_MODULES, + 'packages': list(PACKAGES), + 'package_dir': PACKAGE_DIRECTORIES, + 'package_data': PACKAGE_DATA, + 'install_requires': INSTALL_REQUIRES, + 'setup_requires': SETUP_REQUIRES, + 'cmdclass': COMMAND_CLASS, + 'tests_require': TESTS_REQUIRE, + 'test_loader': TEST_LOADER, + 'test_runner': TEST_RUNNER, +} + +precompiled.update_setup_arguments(setup_arguments) + +setuptools.setup(**setup_arguments) diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 58af6bebf56..aa29c728f25 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -46,21 +46,11 @@ from setuptools.command import build_py from setuptools.command import easy_install from setuptools.command import install from setuptools.command import test -from wheel import bdist_wheel import support PYTHON_STEM = os.path.dirname(os.path.abspath(__file__)) -BINARIES_REPOSITORY = os.environ.get( - 'GRPC_PYTHON_BINARIES_REPOSITORY', - 'https://storage.googleapis.com/grpc-precompiled-binaries/python') - -USE_GRPC_CUSTOM_BDIST = bool(int(os.environ.get( - 'GRPC_PYTHON_USE_CUSTOM_BDIST', '1'))) - -GRPC_CUSTOM_BDIST_EXT = '.whl' - CONF_PY_ADDENDUM = """ extensions.append('sphinx.ext.napoleon') napoleon_google_docstring = True @@ -111,98 +101,6 @@ def _get_grpc_custom_bdist(decorated_basename, target_bdist_basename): return bdist_path -class WheelNameMixin(object): - """Mixin for setuptools.Command classes to enable acquiring the bdist name.""" - - def wheel_custom_name(self): - base = self.wheel_name() - # Drop troublesome parts of the target tuple - base_split = base.split('-') - base = '-'.join(base_split[0:3] + base_split[4:]) - flavor = 'ucs2' if sys.maxunicode == 65535 else 'ucs4' - return '{base}-{flavor}'.format(base=base, flavor=flavor) - - def wheel_name(self): - wheel_command = self.get_finalized_command('bdist_wheel') - return wheel_command.get_archive_basename() - - -class Install(install.install, WheelNameMixin): - """Custom Install command for gRPC Python. - - This is for bdist shims and whatever else we might need a custom install - command for. - """ - - user_options = install.install.user_options + [ - # TODO(atash): remove this once PyPI has better Linux bdist support. See - # https://bitbucket.org/pypa/pypi/issues/120/binary-wheels-for-linux-are-not-supported - ('use-grpc-custom-bdist', None, - 'Whether to retrieve a binary from the gRPC binary repository instead ' - 'of building from source.'), - ] - - def initialize_options(self): - install.install.initialize_options(self) - self.use_grpc_custom_bdist = USE_GRPC_CUSTOM_BDIST - - def finalize_options(self): - install.install.finalize_options(self) - - def run(self): - if self.use_grpc_custom_bdist: - try: - try: - bdist_path = _get_grpc_custom_bdist(self.wheel_custom_name(), - self.wheel_name()) - except CommandError as error: - sys.stderr.write( - '\nWARNING: Failed to acquire grpcio prebuilt binary:\n' - '{}.\n\n'.format(error.message)) - raise - try: - self._run_bdist_retrieval_install(bdist_path) - except Exception as error: - # if anything else happens (and given how there's no way to really know - # what's happening in setuptools here, I mean *anything*), warn the user - # and fall back to building from source. - sys.stderr.write( - '{}\nWARNING: Failed to install grpcio prebuilt binary.\n\n' - .format(traceback.format_exc())) - raise - except Exception: - install.install.run(self) - else: - install.install.run(self) - - # TODO(atash): Remove this once PyPI has better Linux bdist support. See - # https://bitbucket.org/pypa/pypi/issues/120/binary-wheels-for-linux-are-not-supported - def _run_bdist_retrieval_install(self, bdist_path): - import pip - pip.main(['install', bdist_path]) - - -class BdistWheelCustomName(bdist_wheel.bdist_wheel, WheelNameMixin): - """Thin wrapper around the bdist command to build with our custom name.""" - - description = ("Create a gRPC custom-named wheel distribution. " - "Cannot be run with any other distribution-related command.") - - def run(self): - # TODO(atash): if the hack we use to support Linux binaries becomes - # 'supported' (i.e. - # https://bitbucket.org/pypa/pypi/issues/120/binary-wheels-for-linux-are-not-supported - # is not solved and we see users beginning to use this command, ill-advised - # as that may be) consider making the following capable of running with - # other distribution-related commands. Currently it depends on the (AFAIK - # undocumented, private) ordering of the distribution files. - bdist_wheel.bdist_wheel.run(self) - output = self.distribution.dist_files[-1][2] - target = os.path.join( - self.dist_dir, '{}.whl'.format(self.wheel_custom_name())) - shutil.move(output, target) - - class SphinxDocumentation(setuptools.Command): """Command to generate documentation via sphinx.""" diff --git a/src/python/grpcio/precompiled.py b/src/python/grpcio/precompiled.py new file mode 100644 index 00000000000..05c651b506f --- /dev/null +++ b/src/python/grpcio/precompiled.py @@ -0,0 +1,102 @@ +# Copyright 2015-2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import os +import platform +import shutil +import sys + +import setuptools + +import commands +import grpc_version + +try: + from urllib2 import urlopen +except ImportError: + from urllib.request import urlopen + +PYTHON_STEM = os.path.dirname(os.path.abspath(__file__)) +BINARIES_REPOSITORY = os.environ.get( + 'GRPC_PYTHON_BINARIES_REPOSITORY', + 'https://storage.googleapis.com/grpc-precompiled-binaries/python') +USE_PRECOMPILED_BINARIES = bool(int(os.environ.get( + 'GRPC_PYTHON_USE_PRECOMPILED_BINARIES', '1'))) + +def _tagged_ext_name(base): + uname = platform.uname() + tags = '-'.join((grpc_version.VERSION, uname[0], uname[4])) + flavor = 'ucs2' if sys.maxunicode == 65535 else 'ucs4' + return '{base}-{tags}-{flavor}'.format(base=base, tags=tags, flavor=flavor) + + +class BuildTaggedExt(setuptools.Command): + + description = 'build the gRPC tagged extensions' + user_options = [] + + def initialize_options(self): + # distutils requires this override. + pass + + def finalize_options(self): + # distutils requires this override. + pass + + def run(self): + if 'linux' in sys.platform: + self.run_command('build_ext') + try: + os.makedirs('dist/') + except OSError: + pass + shutil.copyfile( + os.path.join(PYTHON_STEM, 'grpc/_cython/cygrpc.so'), + 'dist/{}.so'.format(_tagged_ext_name('cygrpc'))) + else: + sys.stderr.write('nothing to do for build_tagged_ext\n') + + +def update_setup_arguments(setup_arguments): + url = '{}/{}.so'.format(BINARIES_REPOSITORY, _tagged_ext_name('cygrpc')) + target_path = os.path.join(PYTHON_STEM, 'grpc/_cython/cygrpc.so') + try: + extension = urlopen(url).read() + except: + sys.stderr.write( + 'could not download precompiled extension: {}\n'.format(url)) + return + try: + with open(target_path, 'w') as target: + target.write(extension) + setup_arguments['ext_modules'] = [] + except: + sys.stderr.write( + 'could not write precompiled extension to directory: {} -> {}\n' + .format(url, target_path)) diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/build_artifact_python.sh index 5768485ca2a..6e7ab911d5b 100755 --- a/tools/run_tests/build_artifact_python.sh +++ b/tools/run_tests/build_artifact_python.sh @@ -46,7 +46,7 @@ fi GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ ${SETARCH_CMD} python setup.py \ - bdist_wheel_grpc_custom + build_tagged_ext GRPC_PYTHON_USE_CUSTOM_BDIST=0 \ GRPC_PYTHON_BUILD_WITH_CYTHON=1 \ From 9406dcbfcc345c86a3ebc08ae2f896d83ba0f1c7 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 12 Feb 2016 14:05:51 -0800 Subject: [PATCH 19/24] Run Node distrib tests on Mac against only one Node version --- tools/run_tests/distribtest_targets.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py index fe26fd51b8b..261f44bc6d9 100644 --- a/tools/run_tests/distribtest_targets.py +++ b/tools/run_tests/distribtest_targets.py @@ -240,10 +240,7 @@ def targets(): RubyDistribTest('linux', 'x64', 'ubuntu1504'), RubyDistribTest('linux', 'x64', 'ubuntu1510'), RubyDistribTest('linux', 'x64', 'ubuntu1604'), - NodeDistribTest('macos', 'x64', None, '0.12'), - NodeDistribTest('macos', 'x64', None, '3'), NodeDistribTest('macos', 'x64', None, '4'), - NodeDistribTest('macos', 'x64', None, '5'), NodeDistribTest('linux', 'x86', 'jessie', '4') ] + [ NodeDistribTest('linux', 'x64', os, version) From 603b076855fd5a6dc85b6aae176029b47d915abf Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Fri, 12 Feb 2016 15:19:22 -0800 Subject: [PATCH 20/24] Fix Python unit tests --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 135c8188850..01faa4c96cd 100644 --- a/setup.py +++ b/setup.py @@ -232,6 +232,7 @@ setup_arguments = { 'setup_requires': SETUP_REQUIRES, 'cmdclass': COMMAND_CLASS, 'tests_require': TESTS_REQUIRE, + 'test_suite': TEST_SUITE, 'test_loader': TEST_LOADER, 'test_runner': TEST_RUNNER, } From dfab11919e1d5386ba505add129e9395d56ae93d Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Fri, 12 Feb 2016 14:48:00 -0800 Subject: [PATCH 21/24] Update Python doc --- src/python/grpcio/README.rst | 38 ++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/python/grpcio/README.rst b/src/python/grpcio/README.rst index c7b5a3bde43..698c760ebe2 100644 --- a/src/python/grpcio/README.rst +++ b/src/python/grpcio/README.rst @@ -1,22 +1,40 @@ gRPC Python =========== -Package for GRPC Python. +Package for gRPC Python. -Dependencies +Installation ------------ -Ensure you have installed the gRPC core. On Mac OS X, install homebrew_. -Run the following command to install gRPC Python. +gRPC Python is available for Linux and Mac OS X running Python 2.7. + +From PyPI +~~~~~~~~~ + +If you are installing locally... :: - $ curl -fsSL https://goo.gl/getgrpc | bash -s python + $ pip install grpcio + +Else system wide (on Ubuntu)... + +:: -This will download and run the [gRPC install script][] to install grpc core. The script then uses pip to install this package. It also installs the Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin for python. + $ sudo pip install grpcio + +From Source +~~~~~~~~~~~ + +Building from source requires that you have the Python headers (usually a +package named `python-dev`). + +:: -Otherwise, `install from source`_ + $ export REPO_ROOT=grpc + $ git clone https://github.com/grpc/grpc.git $REPO_ROOT + $ cd $REPO_ROOT + $ pip install . -.. _`install from source`: https://github.com/grpc/grpc/blob/master/src/python/README.md#building-from-source -.. _homebrew: http://brew.sh -.. _`gRPC install script`: https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install +Note that `$REPO_ROOT` can be assigned to whatever directory name floats your +fancy. From 7a925f7f5e6c83b41f30b300de1c327b81d04ad2 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 13 Feb 2016 00:39:12 +0100 Subject: [PATCH 22/24] Flagging the release. --- Makefile | 2 +- build.yaml | 3 +-- package.json | 2 +- src/core/surface/version.c | 2 +- src/csharp/Grpc.Core/VersionInfo.cs | 2 +- src/csharp/build_packages.bat | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/doxygen/Doxyfile.core | 2 +- tools/doxygen/Doxyfile.core.internal | 2 +- 12 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index e86e8f15e57..5927d24ab48 100644 --- a/Makefile +++ b/Makefile @@ -361,7 +361,7 @@ E = @echo Q = @ endif -VERSION = 0.13.0-pre1 +VERSION = 0.13.0 CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/build.yaml b/build.yaml index 707743557cd..598d3139ac6 100644 --- a/build.yaml +++ b/build.yaml @@ -7,8 +7,7 @@ settings: '#3': Use "-preN" suffixes to identify pre-release versions '#4': Per-language overrides are possible with (eg) ruby_version tag here '#5': See the expand_version.py for all the quirks here - python_version: 0.13.0-pre2 - version: 0.13.0-pre1 + version: 0.13.0 filegroups: - name: census public_headers: diff --git a/package.json b/package.json index b3888afde75..827231cac72 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "0.13.0-pre1", + "version": "0.13.0", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", diff --git a/src/core/surface/version.c b/src/core/surface/version.c index fc883da189d..c8de7537f1f 100644 --- a/src/core/surface/version.c +++ b/src/core/surface/version.c @@ -36,4 +36,4 @@ #include -const char *grpc_version_string(void) { return "0.13.0-pre1"; } +const char *grpc_version_string(void) { return "0.13.0"; } diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index 1460995fc37..d62cd4f020a 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -46,6 +46,6 @@ namespace Grpc.Core /// /// Current version of gRPC C# /// - public const string CurrentVersion = "0.13.0-pre1"; + public const string CurrentVersion = "0.13.0"; } } diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 8ffd671011d..e423545ef8c 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -1,7 +1,7 @@ @rem Builds gRPC NuGet packages @rem Current package versions -set VERSION=0.13.0-pre1 +set VERSION=0.13.0 set PROTOBUF_VERSION=3.0.0-beta2 @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well. diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index c1cf33d1b11..45a1073e31b 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='0.13.0rc2' +VERSION='0.13.0' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index d7aa18be3e2..95e1b8273d2 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '0.13.0.pre1' + VERSION = '0.13.0' end diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 1a15e3972c5..1a62f0f40ad 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.13.0-pre1 +PROJECT_NUMBER = 0.13.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 41a0547a5c0..84449e59dd8 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.13.0-pre1 +PROJECT_NUMBER = 0.13.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index a94970c65e8..306768335fe 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.13.0-pre1 +PROJECT_NUMBER = 0.13.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 0ab8208a9bb..a3e899fc79c 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.13.0-pre1 +PROJECT_NUMBER = 0.13.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From 6910ce8e01d56b642e2b722b285be78132ffc991 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 13 Feb 2016 01:03:26 +0100 Subject: [PATCH 23/24] Flagging 0.13.1-pre1. --- Makefile | 2 +- build.yaml | 2 +- package.json | 2 +- src/core/surface/version.c | 2 +- src/csharp/Grpc.Core/VersionInfo.cs | 4 ++-- src/csharp/build_packages.bat | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/doxygen/Doxyfile.core | 2 +- tools/doxygen/Doxyfile.core.internal | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 5927d24ab48..83a85c9c1bd 100644 --- a/Makefile +++ b/Makefile @@ -361,7 +361,7 @@ E = @echo Q = @ endif -VERSION = 0.13.0 +VERSION = 0.13.1-pre1 CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/build.yaml b/build.yaml index 598d3139ac6..ec208ee00d8 100644 --- a/build.yaml +++ b/build.yaml @@ -7,7 +7,7 @@ settings: '#3': Use "-preN" suffixes to identify pre-release versions '#4': Per-language overrides are possible with (eg) ruby_version tag here '#5': See the expand_version.py for all the quirks here - version: 0.13.0 + version: 0.13.1-pre1 filegroups: - name: census public_headers: diff --git a/package.json b/package.json index 827231cac72..94e8d03bd0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "0.13.0", + "version": "0.13.1-pre1", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", diff --git a/src/core/surface/version.c b/src/core/surface/version.c index c8de7537f1f..19f0983c0f4 100644 --- a/src/core/surface/version.c +++ b/src/core/surface/version.c @@ -36,4 +36,4 @@ #include -const char *grpc_version_string(void) { return "0.13.0"; } +const char *grpc_version_string(void) { return "0.13.1-pre1"; } diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index d62cd4f020a..04741ae8352 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -41,11 +41,11 @@ namespace Grpc.Core /// /// Current version of gRPC C# assemblies /// - public const string CurrentAssemblyVersion = "0.13.0.0"; + public const string CurrentAssemblyVersion = "0.13.1.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "0.13.0"; + public const string CurrentVersion = "0.13.1-pre1"; } } diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index e423545ef8c..7cf962bdc22 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -1,7 +1,7 @@ @rem Builds gRPC NuGet packages @rem Current package versions -set VERSION=0.13.0 +set VERSION=0.13.1-pre1 set PROTOBUF_VERSION=3.0.0-beta2 @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well. diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index 45a1073e31b..db23de2fedd 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='0.13.0' +VERSION='0.13.1rc1' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 95e1b8273d2..42c94f06c82 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '0.13.0' + VERSION = '0.13.1.pre1' end diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 1a62f0f40ad..0123a4b5bed 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.13.0 +PROJECT_NUMBER = 0.13.1-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 84449e59dd8..da509235b17 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.13.0 +PROJECT_NUMBER = 0.13.1-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index 306768335fe..8995cfbfee7 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.13.0 +PROJECT_NUMBER = 0.13.1-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index a3e899fc79c..fb6958ffc3f 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.13.0 +PROJECT_NUMBER = 0.13.1-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From 50d7e3c4ebf5203941f57c775482812150662199 Mon Sep 17 00:00:00 2001 From: vjpai Date: Fri, 12 Feb 2016 23:09:04 -0800 Subject: [PATCH 24/24] I merged this without checking the copyright. My mistake... --- include/grpc++/create_channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/grpc++/create_channel.h b/include/grpc++/create_channel.h index e9ccb515039..80eed067b7d 100644 --- a/include/grpc++/create_channel.h +++ b/include/grpc++/create_channel.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without