blob: a3133b5aad3f132def9de66345f8108674b1d721 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
gRPC Python
=========
The Python facility of gRPC.
Status
-------
Beta : Core behavior well-used and proven; bugs lurk off the beaten path.
PREREQUISITES
-------------
- python-virtualenv, python-pip, python3-pip, python-dev, python3-dev
- [homebrew][] on Mac OS X. These simplify the installation of the gRPC C core.
INSTALLATION
-------------
**Linux (Debian):**
Add [Debian jessie-backports][] to your `sources.list` file. Example:
```sh
echo "deb http://http.debian.net/debian jessie-backports main" | \
sudo tee -a /etc/apt/sources.list
```
Install the gRPC Debian package
```sh
sudo apt-get update
sudo apt-get install libgrpc-dev
```
Install the gRPC Python module
```sh
sudo pip install grpcio
```
**Mac OS X**
Install [homebrew][]. Run the following command to install gRPC Python.
```sh
$ curl -fsSL https://goo.gl/getgrpc | bash -s python
```
This will download and run the [gRPC install script][], then install the latest version of the gRPC Python package. It also installs the Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin for python.
EXAMPLES
--------
Please read our online documentation for a [Quick Start][] and a [detailed example][]
BUILDING FROM SOURCE
---------------------
- Clone this repository
- Initialize the git submodules
```
$ git submodule update --init
```
- Make the libraries
```
$ make
```
- Use build_python.sh to build the Python code and install it into a virtual environment
```
$ CONFIG=opt tools/run_tests/build_python.sh 2.7
```
TESTING
-------
- Use run_python.sh to run gRPC as it was installed into the virtual environment
```
$ CONFIG=opt PYVER=2.7 tools/run_tests/run_python.sh
```
PACKAGING
---------
- Install packaging dependencies
```
$ pip install setuptools twine
```
- Push to PyPI
```
$ ../../tools/distrib/python/submit.py
```
[homebrew]:http://brew.sh
[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
[Quick Start]:http://www.grpc.io/docs/tutorials/basic/python.html
[detailed example]:http://www.grpc.io/docs/installation/python.html
[Debian jessie-backports]:http://backports.debian.org/Instructions/
|