pycapnp/docs/install.rst

63 lines
2.1 KiB
ReStructuredText
Raw Normal View History

2013-08-18 21:49:12 -07:00
.. _install:
Installation
===================
C++ Cap'n Proto Library
2013-08-21 17:46:50 -07:00
------------------------
2013-08-18 21:49:12 -07:00
2013-08-31 19:12:44 -07:00
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 <http://kentonv.github.io/capnproto/install.html>`_, or if you're feeling lazy, you can run the commands below::
2013-08-18 21:49:12 -07:00
curl -O http://capnproto.org/capnproto-c++-0.3.0.tar.gz
tar zxf capnproto-c++-0.3.0.tar.gz
cd capnproto-c++-0.3.0
2013-08-18 21:49:12 -07:00
./configure
make -j6 check
2013-08-18 21:49:12 -07:00
sudo make install
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::
[sudo] pip install -U cython
[sudo] pip install -U setuptools
[sudo] pip install pycapnp
On some systems you will have to install Python's headers before doing any of this. For Debian/Ubuntu, this is::
sudo apt-get install python-dev
2013-08-18 21:49:12 -07:00
2013-09-03 22:10:37 -07:00
You can control what compiler is used with the environment variable CC, ie. `CC=gcc-4.8 pip install pycapnp`. You only need to run the setuptools line if you have a setuptools older than v0.8.0, and the cython line if you have a version older than v0.19.1.
2013-08-18 21:49:12 -07:00
From Source
---------------------
If you want the latest development version, you can clone the github repo and install like so::
git clone https://github.com/jparyani/pycapnp.git
cd pycapnp
pip install .
2013-08-18 21:49:12 -07:00
or::
cd pycapnp
2013-08-18 21:49:12 -07:00
python setup.py install
2013-08-26 11:12:56 -07:00
If you don't use pip, you will need to manually install Cython, and a setuptools with a version >= .8.
2013-08-18 21:49:12 -07:00
2013-08-28 22:55:10 -07:00
Development
-------------------
Clone the repo from https://github.com/jparyani/pycapnp.git and use the `develop` branch. I'll probably ask you to redo pull requests that target `master` and aren't easily mergable to `develop`::
2013-08-28 22:55:10 -07:00
git clone https://github.com/jparyani/pycapnp.git
2013-08-28 22:55:10 -07:00
git checkout develop
Testing is done through pytest, like so::
pip install pytest
py.test
2013-08-28 22:55:10 -07:00
2013-08-18 21:49:12 -07:00
Once you're done installing, take a look at the :ref:`quickstart`