|
| 1 | +Python Client for Riak |
| 2 | +====================== |
| 3 | + |
| 4 | +Documentation |
| 5 | +============= |
| 6 | + |
| 7 | +[Documentation for the Riak Python Client Library](http://basho.github.io/riak-python-client/index.html) is available here. The documentation source is found in [`docs/` subdirectory](https://github.com/basho/riak-python-client/tree/master/docs) and can be built with [Sphinx](http://sphinx.pocoo.org/). |
| 8 | + |
| 9 | +Documentation for Riak is available [here](http://docs.basho.com/riak/latest). |
| 10 | + |
| 11 | +Install |
| 12 | +======= |
| 13 | + |
| 14 | +The recommended versions of Python for use with this client are Python `2.7.x`, `3.3.x`, `3.4.x` and `3.5.x`. The latest version from each series should be preferred. |
| 15 | + |
| 16 | +Riak TS (Timeseries) |
| 17 | +=================== |
| 18 | + |
| 19 | +You must use version `2.7.11`, `3.4.4` or `3.5.1` (or greater within a version series). Otherwise you will be affected by [this Python bug](https://bugs.python.org/issue23517). |
| 20 | + |
| 21 | +From Source |
| 22 | +----------- |
| 23 | + |
| 24 | +```sh |
| 25 | +python setup.py install |
| 26 | +``` |
| 27 | + |
| 28 | +There are additional dependencies on Python packages `setuptools` and `protobuf`. |
| 29 | + |
| 30 | +From PyPI |
| 31 | +--------- |
| 32 | + |
| 33 | +Official packages are signed and published to [PyPI](https://pypi.python.org/pypi/riak). |
| 34 | + |
| 35 | +To install from [PyPI](https://pypi.python.org/pypi/riak) directly you can use `pip`. |
| 36 | + |
| 37 | +```sh |
| 38 | +pip install riak |
| 39 | +``` |
| 40 | + |
| 41 | +Testing |
| 42 | +======= |
| 43 | + |
| 44 | +To setup the default test configuration build a test Riak node (from a `riak` directory) |
| 45 | + |
| 46 | +```sh |
| 47 | +make rel |
| 48 | +``` |
| 49 | + |
| 50 | +See [Basic Cluster Setup](http://docs.basho.com/riak/2.0.0/ops/building/basic-cluster-setup/) for more details. |
| 51 | + |
| 52 | +For all of the simple default values, set the `RIAK_DIR` environment variable to the root of your Riak installation. Then from the `riak-python-client` directory |
| 53 | + |
| 54 | +```sh |
| 55 | +make -C buildbot preconfigure |
| 56 | +``` |
| 57 | + |
| 58 | +Start your Riak node with `riak start` from the the Riak directory, then |
| 59 | + |
| 60 | +```sh |
| 61 | +make -C buildbot configure |
| 62 | +make -C buildbot test |
| 63 | +``` |
| 64 | + |
| 65 | +That will run the test suite twice: once with security enabled and once without. |
| 66 | + |
| 67 | +Connections to Riak in Tests |
| 68 | +---------------------------- |
| 69 | + |
| 70 | +If your Riak server isn't running on localhost or you have built a Riak devrel from source, use the environment variables `RIAK_TEST_HOST`, `RIAK_TEST_HTTP_PORT` and `RIAK_TEST_PB_PORT` to specify where to find the Riak server. `RIAK_TEST_PROTOCOL` to specify which protocol to test. Can be either `pbc` or `http`. |
| 71 | + |
| 72 | +Some of the connection tests need port numbers that are NOT in use. If ports 1023 and 1022 are in use on your test system, set the environment variables `DUMMY_HTTP_PORT` and `DUMMY_PB_PORT` to unused port numbers. |
| 73 | + |
| 74 | +Testing Search |
| 75 | +-------------- |
| 76 | + |
| 77 | +If you don't have [Riak Search](http://docs.basho.com/riak/latest/dev/using/search/) enabled, you can set the `RUN_SEARCH` environment variable to 0 skip those tests. |
| 78 | + |
| 79 | +If you don't have [Search 2.0](https://github.com/basho/yokozuna) enabled, you can set the `RUN_YZ` environment variable to 0 to skip those tests. |
| 80 | + |
| 81 | +Testing Bucket Types (Riak 2+) |
| 82 | +------------------------------ |
| 83 | + |
| 84 | +To test bucket-types, you must run the `create_bucket_types` setup command, which will create the bucket-types used in testing, or create them manually yourself. It can be run like so (substituting `$RIAK` with the root of your Riak install) |
| 85 | + |
| 86 | +```sh |
| 87 | +./setup.py create_bucket_types --riak-admin=$RIAK/bin/riak-admin |
| 88 | +``` |
| 89 | + |
| 90 | +You may alternately add these lines to `setup.cfg` |
| 91 | + |
| 92 | +```ini |
| 93 | +[create_bucket_types] |
| 94 | +riak-admin=/Users/sean/dev/riak/rel/riak/bin/riak-admin |
| 95 | +``` |
| 96 | + |
| 97 | +To skip the bucket-type tests, set the `RUN_BTYPES` environment variable to `0`. |
| 98 | + |
| 99 | +Testing Data Types (Riak 2+) |
| 100 | +---------------------------- |
| 101 | + |
| 102 | +To test data types, you must set up bucket types (see above.) |
| 103 | + |
| 104 | +To skip the data type tests, set the `RUN_DATATYPES` environment variable to `0`. |
| 105 | + |
| 106 | +Testing Timeseries (Riak 2.1+) |
| 107 | +------------------------------ |
| 108 | + |
| 109 | +To test timeseries data, you must run the `setup_timeseries` command, which will create the bucket-types used in testing, or create them manually yourself. It can be run like so (substituting `$RIAK` with the root of your Riak install) |
| 110 | + |
| 111 | +```sh |
| 112 | +./setup.py setup_timeseries --riak-admin=$RIAK/bin/riak-admin |
| 113 | +``` |
| 114 | + |
| 115 | +You may alternately add these lines to `setup.cfg` |
| 116 | + |
| 117 | +```sh |
| 118 | +[setup_timeseries] |
| 119 | +riak-admin=/Users/sean/dev/riak/rel/riak/bin/riak-admin |
| 120 | +``` |
| 121 | + |
| 122 | +To enable the timeseries tests, set the `RUN_TIMESERIES` environment variable to `1`. |
| 123 | + |
| 124 | +Testing Secondary Indexes |
| 125 | +------------------------- |
| 126 | + |
| 127 | +To test [Secondary Indexes](http://docs.basho.com/riak/2.0.0/dev/using/2i/), the `RUN_INDEXES` environment variable must be set to 1 (or 0 to skip them.) |
| 128 | + |
| 129 | +Testing Security (Riak 2+) |
| 130 | +-------------------------- |
| 131 | + |
| 132 | +Ensure that the hostname `riak-test` resolves to your Riak host (most likely `localhost`). This is so the SSL host verification can succeed. |
| 133 | + |
| 134 | +By default [Security](http://docs.basho.com/riak/2.0.0beta1/ops/running/authz/) is not enabled on Riak. Once `security = on` is configured in the `riak.conf` file it can be enabled with `riak-admin`. |
| 135 | + |
| 136 | +To run the tests |
| 137 | + |
| 138 | +```sh |
| 139 | +RUN_SECURITY=1 RIAK_TEST_HTTP_PORT=18098 python setup.py test |
| 140 | +``` |
| 141 | + |
| 142 | +Contributors |
| 143 | +-------------------------- |
| 144 | + |
| 145 | +* Andrew Thompson |
| 146 | +* Andy Gross |
| 147 | +* Armon Dadgar |
| 148 | +* Brett Hazen |
| 149 | +* Brett Hoerner |
| 150 | +* Brian Roach |
| 151 | +* Bryan Fink |
| 152 | +* Daniel Lindsley |
| 153 | +* Daniel Néri |
| 154 | +* Daniel Reverri |
| 155 | +* David Koblas |
| 156 | +* Dmitry Rozhkov |
| 157 | +* Eric Florenzano |
| 158 | +* Eric Moritz |
| 159 | +* Filip de Waard |
| 160 | +* Gilles Devaux |
| 161 | +* Greg Nelson |
| 162 | +* Gregory Burd |
| 163 | +* Greg Stein |
| 164 | +* Ian Plosker |
| 165 | +* Jayson Baird |
| 166 | +* Jeffrey Massung |
| 167 | +* Jon Meredith |
| 168 | +* Josip Lisec |
| 169 | +* Justin Sheehy |
| 170 | +* Kevin Smith |
| 171 | +* [Luke Bakken](https://github.com/lukebakken) |
| 172 | +* Mark Erdmann |
| 173 | +* Mark Phillips |
| 174 | +* Mathias Meyer |
| 175 | +* Matt Heitzenroder |
| 176 | +* Mikhail Sobolev |
| 177 | +* Reid Draper |
| 178 | +* Russell Brown |
| 179 | +* Rusty Klophaus |
| 180 | +* Rusty Klophaus |
| 181 | +* Scott Lystig Fritchie |
| 182 | +* Sean Cribbs |
| 183 | +* Shuhao Wu |
| 184 | +* Silas Sewell |
| 185 | +* Socrates Lee |
| 186 | +* Soren Hansen |
| 187 | +* Sreejith Kesavan |
| 188 | +* Timothée Peignier |
| 189 | +* William Kral |
0 commit comments