aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/README.md
blob: b5eea239f33273f04478f52cc4a7f95a21629225 (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
gRPC Python
=========

The Python facility of gRPC.


Status
-------

Usable with limitations, Alpha

Prerequisites
-----------------------

Python 2.7, virtualenv, pip, libprotobuf-dev, and libprotoc-dev.


Building from source
----------------------

- Build the gRPC core from the root of the
  [gRPC git repo](https://github.com/grpc/grpc)
```
$ make shared_c static_c
```

- Use build_python.sh to build the Python code and install it into a virtual environment
```
$ tools/run_tests/build_python.sh
```


Testing
-----------------------

- Use run_python.sh to run gRPC as it was installed into the virtual environment
```
$ tools/run_tests/run_python.sh
```


Installing
-----------------------

- Install the gRPC core
  - [Debian package](https://github.com/grpc/grpc/releases)
    ```
    $ wget https://github.com/grpc/grpc/releases/download/release-0_5_0/libgrpc_0.5.0_amd64.deb
    $ wget https://github.com/grpc/grpc/releases/download/release-0_5_0/libgrpc-dev_0.5.0_amd64.deb
    $ sudo dpkg -i libgrpc_0.5.0_amd64.deb libgrpc-dev_0.5.0_amd64.deb
    ```
  - [From source](https://github.com/grpc/grpc/blob/master/INSTALL)

- Install gRPC Python's dependencies
```
$ pip install -r src/python/requirements.txt
```

- Install gRPC Python
```
$ pip install src/python/src
```

Packaging to PyPI
-----------------------

- Install packaging dependencies
```
$ pip install setuptools twine
```

- Push to PyPI
```
$ ../../tools/distrib/python/submit.py
```