Merge pull request #5540 from soltanmm/upmerge

Merge release-0_13 into master
pull/5698/head
Craig Tiller 9 years ago
commit 6387add103
  1. 1
      setup.py
  2. 2
      src/node/src/client.js
  3. 12
      src/python/grpcio/README.rst
  4. 3
      src/python/grpcio/commands.py
  5. 13
      src/python/grpcio/precompiled.py
  6. 14
      tools/distrib/python/docgen.py

@ -154,6 +154,7 @@ INSTALL_REQUIRES = (
SETUP_REQUIRES = ( SETUP_REQUIRES = (
'sphinx>=1.3', 'sphinx>=1.3',
'sphinx_rtd_theme>=0.1.8'
) + INSTALL_REQUIRES ) + INSTALL_REQUIRES
COMMAND_CLASS = { COMMAND_CLASS = {

@ -408,7 +408,7 @@ function makeUnaryRequestFunction(method, serialize, deserialize) {
} }
} }
if (status.code !== grpc.status.OK) { if (status.code !== grpc.status.OK) {
error = new Error(response.status.details); error = new Error(status.details);
error.code = status.code; error.code = status.code;
error.metadata = status.metadata; error.metadata = status.metadata;
callback(error); callback(error);

@ -6,7 +6,7 @@ Package for gRPC Python.
Installation Installation
------------ ------------
gRPC Python is available for Linux and Mac OS X running Python 2.7. gRPC Python is available for Linux, Mac OS X, and Windows running Python 2.7.
From PyPI From PyPI
~~~~~~~~~ ~~~~~~~~~
@ -23,11 +23,15 @@ Else system wide (on Ubuntu)...
$ sudo pip install grpcio $ sudo pip install grpcio
n.b. On Windows and on Mac OS X one *must* have a recent release of :code:`pip`
to retrieve the proper wheel from PyPI. Be sure to upgrade to the latest
version!
From Source From Source
~~~~~~~~~~~ ~~~~~~~~~~~
Building from source requires that you have the Python headers (usually a Building from source requires that you have the Python headers (usually a
package named `python-dev`). package named :code:`python-dev`).
:: ::
@ -36,8 +40,8 @@ package named `python-dev`).
$ cd $REPO_ROOT $ cd $REPO_ROOT
$ pip install . $ pip install .
Note that `$REPO_ROOT` can be assigned to whatever directory name floats your Note that :code:`$REPO_ROOT` can be assigned to whatever directory name floats
fancy. your fancy.
Troubleshooting Troubleshooting
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~

@ -119,8 +119,7 @@ class SphinxDocumentation(setuptools.Command):
import sphinx import sphinx
import sphinx.apidoc import sphinx.apidoc
metadata = self.distribution.metadata metadata = self.distribution.metadata
src_dir = os.path.join( src_dir = os.path.join(PYTHON_STEM, 'grpc')
PYTHON_STEM, self.distribution.package_dir[''], 'grpc')
sys.path.append(src_dir) sys.path.append(src_dir)
sphinx.apidoc.main([ sphinx.apidoc.main([
'', '--force', '--full', '-H', metadata.name, '-A', metadata.author, '', '--force', '--full', '-H', metadata.name, '-A', metadata.author,

@ -31,6 +31,7 @@ import os
import platform import platform
import shutil import shutil
import sys import sys
import sysconfig
import setuptools import setuptools
@ -51,9 +52,15 @@ USE_PRECOMPILED_BINARIES = bool(int(os.environ.get(
def _tagged_ext_name(base): def _tagged_ext_name(base):
uname = platform.uname() uname = platform.uname()
tags = '-'.join((grpc_version.VERSION, uname[0], uname[4])) tags = (
flavor = 'ucs2' if sys.maxunicode == 65535 else 'ucs4' grpc_version.VERSION,
return '{base}-{tags}-{flavor}'.format(base=base, tags=tags, flavor=flavor) 'py{}'.format(sysconfig.get_python_version()),
uname[0],
uname[4],
)
ucs = 'ucs{}'.format(sysconfig.get_config_var('Py_UNICODE_SIZE'))
return '{base}-{tags}-{ucs}'.format(
base=base, tags='-'.join(tags), ucs=ucs)
class BuildTaggedExt(setuptools.Command): class BuildTaggedExt(setuptools.Command):

@ -1,5 +1,5 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -51,29 +51,35 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, '..', '..', '..')) PROJECT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, '..', '..', '..'))
CONFIG = args.config CONFIG = args.config
SETUP_PATH = os.path.join(PROJECT_ROOT, 'src/python/grpcio/setup.py') SETUP_PATH = os.path.join(PROJECT_ROOT, 'setup.py')
DOC_PATH = os.path.join(PROJECT_ROOT, 'src/python/grpcio/doc/build') REQUIREMENTS_PATH = os.path.join(PROJECT_ROOT, 'requirements.txt')
DOC_PATH = os.path.join(PROJECT_ROOT, 'doc/build')
INCLUDE_PATH = os.path.join(PROJECT_ROOT, 'include') INCLUDE_PATH = os.path.join(PROJECT_ROOT, 'include')
LIBRARY_PATH = os.path.join(PROJECT_ROOT, 'libs/{}'.format(CONFIG)) LIBRARY_PATH = os.path.join(PROJECT_ROOT, 'libs/{}'.format(CONFIG))
VIRTUALENV_DIR = os.path.join(SCRIPT_DIR, 'distrib_virtualenv') VIRTUALENV_DIR = os.path.join(SCRIPT_DIR, 'distrib_virtualenv')
VIRTUALENV_PYTHON_PATH = os.path.join(VIRTUALENV_DIR, 'bin', 'python') VIRTUALENV_PYTHON_PATH = os.path.join(VIRTUALENV_DIR, 'bin', 'python')
VIRTUALENV_PIP_PATH = os.path.join(VIRTUALENV_DIR, 'bin', 'pip')
environment = os.environ.copy() environment = os.environ.copy()
environment.update({ environment.update({
'CONFIG': CONFIG, 'CONFIG': CONFIG,
'CFLAGS': '-I{}'.format(INCLUDE_PATH), 'CFLAGS': '-I{}'.format(INCLUDE_PATH),
'LDFLAGS': '-L{}'.format(LIBRARY_PATH), 'LDFLAGS': '-L{}'.format(LIBRARY_PATH),
'LD_LIBRARY_PATH': LIBRARY_PATH 'LD_LIBRARY_PATH': LIBRARY_PATH,
'GRPC_PYTHON_BUILD_WITH_CYTHON': '1',
}) })
subprocess_arguments_list = [ subprocess_arguments_list = [
{'args': ['make'], 'cwd': PROJECT_ROOT}, {'args': ['make'], 'cwd': PROJECT_ROOT},
{'args': ['virtualenv', VIRTUALENV_DIR], 'env': environment}, {'args': ['virtualenv', VIRTUALENV_DIR], 'env': environment},
{'args': [VIRTUALENV_PIP_PATH, 'install', '-r', REQUIREMENTS_PATH],
'env': environment},
{'args': [VIRTUALENV_PYTHON_PATH, SETUP_PATH, 'build'], 'env': environment}, {'args': [VIRTUALENV_PYTHON_PATH, SETUP_PATH, 'build'], 'env': environment},
{'args': [VIRTUALENV_PYTHON_PATH, SETUP_PATH, 'doc'], 'env': environment}, {'args': [VIRTUALENV_PYTHON_PATH, SETUP_PATH, 'doc'], 'env': environment},
] ]
for subprocess_arguments in subprocess_arguments_list: for subprocess_arguments in subprocess_arguments_list:
print('Running command: {}'.format(subprocess_arguments['args']))
subprocess.check_call(**subprocess_arguments) subprocess.check_call(**subprocess_arguments)
if args.submit: if args.submit:

Loading…
Cancel
Save