Skip to content

Commit

Permalink
Fix documentation on how to install optional features (issue #645) (#822
Browse files Browse the repository at this point in the history
)

* Fix documentation on how to install optional features (issue #645)

* Show more output from failed broker log

* Raise wait_kafka timeout
  • Loading branch information
ods committed Feb 6, 2022
1 parent ccbcc25 commit 2c54e10
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGES/645.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix documentation on how to install optional features (issue #645)
30 changes: 13 additions & 17 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ Welcome to aiokafka's documentation!

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

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

.. code::
pip3 install aiokafka
pip install aiokafka
.. note:: **aiokafka** requires the kafka-python_ library.


Optional LZ4 install
++++++++++++++++++++

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

pip3 install lz4tools
pip3 install xxhash
pip install 'aiokafka[lz4]'

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

.. code:: bash
pip3 install python-snappy
For **Windows** the easiest way is to fetch a precompiled wheel from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-snappy
pip install 'aiokafka[snappy]'
Optional zstd indtall
+++++++++++++++++++++

To enable Zstandard compression/decompression, install zstandard:
To enable Zstandard compression/decompression, install **aiokafka** with :code:`zstd` extra option:

.. code:: bash
>>> pip3 install zstandard
pip install 'aiokafka[zstd]'
Optional GSSAPI install
+++++++++++++++++++++++

To enable SASL authentication with GSSAPI you need to install `gssapi`_:
To enable SASL authentication with GSSAPI, install **aiokafka** with :code:`gssapi` extra option:

.. code:: bash
>>> pip3 install gssapi
pip install 'aiokafka[gssapi]'
Source code
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def read(f):
"snappy": ["python-snappy>=0.5"],
"lz4": ["lz4"], # Old format (magic=0) requires xxhash
"zstd": ["zstandard"],
"gssapi": ["gssapi"],
}
extras_require["all"] = sum(extras_require.values(), [])

Expand Down
2 changes: 1 addition & 1 deletion tests/_testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def random_string(length):
return s.encode('utf-8')


def wait_kafka(kafka_host, kafka_port, timeout=60):
def wait_kafka(kafka_host, kafka_port, timeout=120):
loop = asyncio.new_event_loop()
try:
res = loop.run_until_complete(
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ def kafka_server(request, docker, docker_ip_address,
try:
if not wait_kafka(kafka_host, kafka_port):
exit_code, output = container.exec_run(
["supervisorctl", "tail", "kafka"])
["supervisorctl", "tail", "-10000", "kafka"])
print("Kafka failed to start. \n--- STDOUT:")
print(output.decode(), file=sys.stdout)
exit_code, output = container.exec_run(
["supervisorctl", "tail", "kafka", "stderr"])
["supervisorctl", "tail", "-10000", "kafka", "stderr"])
print("--- STDERR:")
print(output.decode(), file=sys.stderr)
pytest.exit("Could not start Kafka Server")
Expand Down

0 comments on commit 2c54e10

Please sign in to comment.