Skip to content

Commit

Permalink
Merge pull request grpc#5540 from soltanmm/upmerge
Browse files Browse the repository at this point in the history
Merge release-0_13 into master
  • Loading branch information
ctiller committed Mar 10, 2016
2 parents e3e640f + 4aaf474 commit 6387add
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def cython_extensions(package_names, module_names, extra_sources, include_dirs,

SETUP_REQUIRES = (
'sphinx>=1.3',
'sphinx_rtd_theme>=0.1.8'
) + INSTALL_REQUIRES

COMMAND_CLASS = {
Expand Down
2 changes: 1 addition & 1 deletion src/node/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ function makeUnaryRequestFunction(method, serialize, deserialize) {
}
}
if (status.code !== grpc.status.OK) {
error = new Error(response.status.details);
error = new Error(status.details);
error.code = status.code;
error.metadata = status.metadata;
callback(error);
Expand Down
12 changes: 8 additions & 4 deletions src/python/grpcio/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Package for gRPC Python.
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
~~~~~~~~~
Expand All @@ -23,11 +23,15 @@ Else system wide (on Ubuntu)...

$ 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
~~~~~~~~~~~

Building from source requires that you have the Python headers (usually a
package named `python-dev`).
package named :code:`python-dev`).

::

Expand All @@ -36,8 +40,8 @@ package named `python-dev`).
$ cd $REPO_ROOT
$ pip install .

Note that `$REPO_ROOT` can be assigned to whatever directory name floats your
fancy.
Note that :code:`$REPO_ROOT` can be assigned to whatever directory name floats
your fancy.

Troubleshooting
~~~~~~~~~~~~~~~
Expand Down
3 changes: 1 addition & 2 deletions src/python/grpcio/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ def run(self):
import sphinx
import sphinx.apidoc
metadata = self.distribution.metadata
src_dir = os.path.join(
PYTHON_STEM, self.distribution.package_dir[''], 'grpc')
src_dir = os.path.join(PYTHON_STEM, 'grpc')
sys.path.append(src_dir)
sphinx.apidoc.main([
'', '--force', '--full', '-H', metadata.name, '-A', metadata.author,
Expand Down
13 changes: 10 additions & 3 deletions src/python/grpcio/precompiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import platform
import shutil
import sys
import sysconfig

import setuptools

Expand All @@ -51,9 +52,15 @@

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)
tags = (
grpc_version.VERSION,
'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):
Expand Down
14 changes: 10 additions & 4 deletions tools/distrib/python/docgen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -51,29 +51,35 @@
PROJECT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, '..', '..', '..'))

CONFIG = args.config
SETUP_PATH = os.path.join(PROJECT_ROOT, 'src/python/grpcio/setup.py')
DOC_PATH = os.path.join(PROJECT_ROOT, 'src/python/grpcio/doc/build')
SETUP_PATH = os.path.join(PROJECT_ROOT, 'setup.py')
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')
LIBRARY_PATH = os.path.join(PROJECT_ROOT, 'libs/{}'.format(CONFIG))
VIRTUALENV_DIR = os.path.join(SCRIPT_DIR, 'distrib_virtualenv')
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.update({
'CONFIG': CONFIG,
'CFLAGS': '-I{}'.format(INCLUDE_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 = [
{'args': ['make'], 'cwd': PROJECT_ROOT},
{'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, 'doc'], 'env': environment},
]

for subprocess_arguments in subprocess_arguments_list:
print('Running command: {}'.format(subprocess_arguments['args']))
subprocess.check_call(**subprocess_arguments)

if args.submit:
Expand Down

0 comments on commit 6387add

Please sign in to comment.