diff --git a/README.md b/README.md index 99c1a75..5dac2a9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ First you need a system-wide installation of the Capnproto C++ library >= 0.3. Unfortunately, as of now, that means you have to build from the HEAD of Cap'n Proto. Follow these instructions to do so: +```bash wget https://github.com/kentonv/capnproto/archive/master.zip unzip master.zip cd capnproto-master/c++ @@ -13,6 +14,13 @@ First you need a system-wide installation of the Capnproto C++ library >= 0.3. U make -j6 check sudo make install sudo ldconfig +``` + +A recent version of setuptools is also required. You can install a newer version with: + +```python +pip install -U setuptools +``` ## Building and installation @@ -89,5 +97,16 @@ f = open('example', 'r') printAddressBook(f.fileno()) ``` +## Common Problems + +If you get an error on installation like: + + ... + gcc-4.8: error: capnp/capnp.c: No such file or directory + + gcc-4.8: fatal error: no input files + +Then you have too old a version of setuptools. Run `pip install -U setuptools` then try again. + [![Build Status](https://travis-ci.org/jparyani/capnpc-python-cpp.png?branch=master)](https://travis-ci.org/jparyani/capnpc-python-cpp) diff --git a/docs/install.rst b/docs/install.rst index fca0e8d..a77fe35 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -4,7 +4,7 @@ Installation =================== C++ Cap'n Proto Library ---------------------- +------------------------ You need to install the C++ Cap'n Proto library first. It requires a C++ compiler with C++11 support, such as GCC 4.7+ or Clang 3.2+. Follow installation docs at `http://kentonv.github.io/capnproto/install.html `_ with an added `sudo ldconfig` after you're done installing, or if you're feeling lazy, you can run the commands below:: @@ -22,9 +22,12 @@ Pip --------------------- Using pip is by far the easiest way to install the library. After you've installed the C++ library, all you need to run is:: - + + pip install -U setuptools pip install capnp +You only need to run the setuptools line if you have a setuptools older than v0.8.0. + From Source --------------------- diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 4ee5b7d..cf632d8 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -8,7 +8,7 @@ This assumes you already have the capnp library installed. If you don't, please In general, this library is a very light wrapping of the `Cap'n Proto C++ library `_. You can refer to its docs for more advanced concepts, or just to get a basic idea of how the python library is structured. Load a Cap'n Proto Schema ------------------------- +------------------------- First you need to import the library:: @@ -66,7 +66,7 @@ First you need to allocate a MessageBuilder for your message to go in. There is message = capnp.MallocMessageBuilder() Initialize a New Cap'n Proto Object -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now that you have a message buffer, you need to allocate an actual object that is from your schema. In this case, we will allocate an `AddressBook`:: @@ -157,7 +157,7 @@ Much like before, you will have to de-serialize the message from a file descript message = capnp.PackedFdMessageReader(f.fileno()) Initialize a New Cap'n Proto Object -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Just like when building, you have to actually specify which message you want to read out of buffer:: diff --git a/setup.py b/setup.py index 024d256..834d502 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ import os MAJOR = 0 MINOR = 3 -MICRO = 0 +MICRO = 1 VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)