Skip to content

Commit 2c54e10

Browse files
authored
Fix documentation on how to install optional features (issue #645) (#822)
* Fix documentation on how to install optional features (issue #645) * Show more output from failed broker log * Raise wait_kafka timeout
1 parent ccbcc25 commit 2c54e10

File tree

5 files changed

+18
-20
lines changed

5 files changed

+18
-20
lines changed

CHANGES/645.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix documentation on how to install optional features (issue #645)

docs/index.rst

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ Welcome to aiokafka's documentation!
33

44
.. _GitHub: https://github.com/aio-libs/aiokafka
55
.. _asyncio: http://docs.python.org/3.7/library/asyncio.html
6-
.. _gssapi: https://pypi.org/project/gssapi/
76
.. _kafka-python: https://github.com/dpkp/kafka-python
8-
.. _lz4tools: https://pypi.org/project/lz4tools/
9-
.. _python-snappy: https://pypi.org/project/python-snappy/
10-
.. _xxhash: https://pypi.org/project/xxhash/
117

128
.. image:: https://img.shields.io/badge/kafka-1.0%2C%200.11%2C%200.10%2C%200.9-brightgreen.svg
139
:target: https://kafka.apache.org
@@ -95,18 +91,17 @@ Installation
9591

9692
.. code::
9793
98-
pip3 install aiokafka
94+
pip install aiokafka
9995
10096
.. note:: **aiokafka** requires the kafka-python_ library.
10197

10298

10399
Optional LZ4 install
104100
++++++++++++++++++++
105101

106-
To enable LZ4 compression/decompression, install `lz4tools`_ and `xxhash`_::
102+
To enable LZ4 compression/decompression, install **aiokafka** with :code:`lz4` extra option:
107103

108-
pip3 install lz4tools
109-
pip3 install xxhash
104+
pip install 'aiokafka[lz4]'
110105

111106
Note, that on **Windows** you will need Visual Studio build tools, available for download
112107
from http://landinghub.visualstudio.com/visual-cpp-build-tools
@@ -141,30 +136,31 @@ From Source:
141136
sudo make install
142137
143138
144-
2. Install the `python-snappy`_ module
139+
1. Install **aiokafka** with :code:`snappy` extra option
145140

146141
.. code:: bash
147142
148-
pip3 install python-snappy
149-
150-
For **Windows** the easiest way is to fetch a precompiled wheel from
151-
http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-snappy
143+
pip install 'aiokafka[snappy]'
152144
153145
154146
Optional zstd indtall
155147
+++++++++++++++++++++
156148

157-
To enable Zstandard compression/decompression, install zstandard:
149+
To enable Zstandard compression/decompression, install **aiokafka** with :code:`zstd` extra option:
150+
151+
.. code:: bash
158152
159-
>>> pip3 install zstandard
153+
pip install 'aiokafka[zstd]'
160154
161155
162156
Optional GSSAPI install
163157
+++++++++++++++++++++++
164158

165-
To enable SASL authentication with GSSAPI you need to install `gssapi`_:
159+
To enable SASL authentication with GSSAPI, install **aiokafka** with :code:`gssapi` extra option:
160+
161+
.. code:: bash
166162
167-
>>> pip3 install gssapi
163+
pip install 'aiokafka[gssapi]'
168164
169165
170166
Source code

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def read(f):
132132
"snappy": ["python-snappy>=0.5"],
133133
"lz4": ["lz4"], # Old format (magic=0) requires xxhash
134134
"zstd": ["zstandard"],
135+
"gssapi": ["gssapi"],
135136
}
136137
extras_require["all"] = sum(extras_require.values(), [])
137138

tests/_testutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def random_string(length):
425425
return s.encode('utf-8')
426426

427427

428-
def wait_kafka(kafka_host, kafka_port, timeout=60):
428+
def wait_kafka(kafka_host, kafka_port, timeout=120):
429429
loop = asyncio.new_event_loop()
430430
try:
431431
res = loop.run_until_complete(

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ def kafka_server(request, docker, docker_ip_address,
220220
try:
221221
if not wait_kafka(kafka_host, kafka_port):
222222
exit_code, output = container.exec_run(
223-
["supervisorctl", "tail", "kafka"])
223+
["supervisorctl", "tail", "-10000", "kafka"])
224224
print("Kafka failed to start. \n--- STDOUT:")
225225
print(output.decode(), file=sys.stdout)
226226
exit_code, output = container.exec_run(
227-
["supervisorctl", "tail", "kafka", "stderr"])
227+
["supervisorctl", "tail", "-10000", "kafka", "stderr"])
228228
print("--- STDERR:")
229229
print(output.decode(), file=sys.stderr)
230230
pytest.exit("Could not start Kafka Server")

0 commit comments

Comments
 (0)