Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
wbarnha authored Mar 9, 2024
2 parents e4bf0d4 + 38e159a commit d26351d
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 81 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Build artifacts
run: python -m build
- name: Upload built artifacts for testing
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.sdist-artifact }}
# NOTE: Exact expected file names are specified here
Expand All @@ -66,10 +66,9 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "pypy3.9"
experimental: [ false ]
include:
- python-version: "pypy3.9"
experimental: true
- python-version: "~3.13.0-0"
experimental: true
steps:
Expand Down Expand Up @@ -115,11 +114,11 @@ jobs:
needs:
- build-sdist
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
kafka-version:
- "0.8.2.2"
- "0.9.0.1"
- "0.10.2.2"
- "0.11.0.2"
Expand All @@ -128,6 +127,11 @@ jobs:
- "2.4.0"
- "2.5.0"
- "2.6.0"
experimental: [false]
include:
- kafka-version: '0.8.2.2'
experimental: true
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Checkout the source code
uses: actions/checkout@v4
Expand Down Expand Up @@ -187,11 +191,11 @@ jobs:
environment: pypi
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Download the sdist artifact
uses: actions/download-artifact@v3
- name: Download the artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: dist
name: ${{ env.sdist-artifact }}
path: dist/${{ env.sdist-name }}
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ Some of the major changes include:
* SASL authentication is working (we think)
* Removed several circular references to improve gc on close()

Thanks to all contributors -- the state of the kafka-python community is strong!
Thanks to all contributors -- the state of the kafka-python-ng community is strong!

Detailed changelog are listed below:

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cov-local: build-integration
@echo "open file://`pwd`/htmlcov/index.html"

# Check the readme for syntax errors, which can lead to invalid formatting on
# PyPi homepage (https://pypi.python.org/pypi/kafka-python)
# PyPi homepage (https://pypi.python.org/pypi/kafka-python-ng)
check-readme:
python setup.py check -rms

Expand Down
45 changes: 28 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ Kafka Python client
------------------------

.. image:: https://img.shields.io/badge/kafka-2.6%2C%202.5%2C%202.4%2C%202.3%2C%202.2%2C%202.1%2C%202.0%2C%201.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
:target: https://kafka-python.readthedocs.io/en/master/compatibility.html
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
:target: https://pypi.python.org/pypi/kafka-python
.. image:: https://coveralls.io/repos/dpkp/kafka-python/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/dpkp/kafka-python?branch=master
:target: https://kafka-python-ng.readthedocs.io/en/master/compatibility.html
.. image:: https://img.shields.io/pypi/pyversions/kafka-python-ng.svg
:target: https://pypi.python.org/pypi/kafka-python-ng
.. image:: https://coveralls.io/repos/wbarnha/kafka-python-ng/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/wbarnha/kafka-python-ng?branch=master
.. image:: https://img.shields.io/badge/license-Apache%202-blue.svg
:target: https://github.com/dpkp/kafka-python/blob/master/LICENSE
.. image:: https://img.shields.io/pypi/dw/kafka-python.svg
:target: https://pypistats.org/packages/kafka-python
:target: https://github.com/wbarnha/kafka-python-ng/blob/master/LICENSE
.. image:: https://img.shields.io/pypi/dw/kafka-python-ng.svg
:target: https://pypistats.org/packages/kafka-python-ng
.. image:: https://img.shields.io/pypi/v/kafka-python.svg
:target: https://pypi.org/project/kafka-python
.. image:: https://img.shields.io/pypi/implementation/kafka-python
:target: https://github.com/dpkp/kafka-python/blob/master/setup.py
:target: https://pypi.org/project/kafka-python-ng
.. image:: https://img.shields.io/pypi/implementation/kafka-python-ng
:target: https://github.com/wbarnha/kafka-python-ng/blob/master/setup.py



Python client for the Apache Kafka distributed stream processing system.
kafka-python is designed to function much like the official java client, with a
kafka-python-ng is designed to function much like the official java client, with a
sprinkling of pythonic interfaces (e.g., consumer iterators).

kafka-python is best used with newer brokers (0.9+), but is backwards-compatible with
kafka-python-ng is best used with newer brokers (0.9+), but is backwards-compatible with
older versions (to 0.8.0). Some features will only be enabled on newer brokers.
For example, fully coordinated consumer groups -- i.e., dynamic partition
assignment to multiple consumers in the same group -- requires use of 0.9+ kafka
Expand All @@ -32,15 +32,19 @@ check code (perhaps using zookeeper or consul). For older brokers, you can
achieve something similar by manually assigning different partitions to each
consumer instance with config management tools like chef, ansible, etc. This
approach will work fine, though it does not support rebalancing on failures.

See https://kafka-python.readthedocs.io/en/master/compatibility.html

for more details.

Please note that the master branch may contain unreleased features. For release
documentation, please see readthedocs and/or python's inline help.


.. code-block:: bash
$ pip install kafka-python
$ pip install kafka-python-ng
KafkaConsumer
Expand All @@ -50,7 +54,9 @@ KafkaConsumer is a high-level message consumer, intended to operate as similarly
as possible to the official java client. Full support for coordinated
consumer groups requires use of kafka brokers that support the Group APIs: kafka v0.9+.


See https://kafka-python.readthedocs.io/en/master/apidoc/KafkaConsumer.html

for API and configuration details.

The consumer iterator returns ConsumerRecords, which are simple namedtuples
Expand Down Expand Up @@ -105,7 +111,9 @@ KafkaProducer

KafkaProducer is a high-level, asynchronous message producer. The class is
intended to operate as similarly as possible to the official java client.

See https://kafka-python.readthedocs.io/en/master/apidoc/KafkaProducer.html

for more details.

.. code-block:: python
Expand Down Expand Up @@ -178,31 +186,34 @@ multiprocessing is recommended.
Compression
***********

kafka-python supports the following compression formats:
kafka-python-ng supports the following compression formats:

- gzip
- LZ4
- Snappy
- Zstandard (zstd)

gzip is supported natively, the others require installing additional libraries.

See https://kafka-python.readthedocs.io/en/master/install.html for more information.



Optimized CRC32 Validation
**************************

Kafka uses CRC32 checksums to validate messages. kafka-python includes a pure
Kafka uses CRC32 checksums to validate messages. kafka-python-ng includes a pure
python implementation for compatibility. To improve performance for high-throughput
applications, kafka-python will use `crc32c` for optimized native code if installed.
See https://kafka-python.readthedocs.io/en/master/install.html for installation instructions.

See https://pypi.org/project/crc32c/ for details on the underlying crc32c lib.


Protocol
********

A secondary goal of kafka-python is to provide an easy-to-use protocol layer
A secondary goal of kafka-python-ng is to provide an easy-to-use protocol layer
for interacting with kafka brokers via the python repl. This is useful for
testing, probing, and general experimentation. The protocol support is
leveraged to enable a KafkaClient.check_version() method that
Expand Down
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/kafka-python.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/kafka-python-ng.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/kafka-python.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/kafka-python-ng.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/kafka-python"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/kafka-python"
@echo "# mkdir -p $$HOME/.local/share/devhelp/kafka-python-ng"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/kafka-python-ng"
@echo "# devhelp"

epub:
Expand Down
2 changes: 1 addition & 1 deletion docs/apidoc/modules.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kafka-python API
kafka-python-ng API
****************

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ Some of the major changes include:
* SASL authentication is working (we think)
* Removed several circular references to improve gc on close()

Thanks to all contributors -- the state of the kafka-python community is strong!
Thanks to all contributors -- the state of the kafka-python-ng community is strong!

Detailed changelog are listed below:

Expand Down
18 changes: 9 additions & 9 deletions docs/compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ Compatibility
-------------

.. image:: https://img.shields.io/badge/kafka-2.6%2C%202.5%2C%202.4%2C%202.3%2C%202.2%2C%202.1%2C%202.0%2C%201.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
:target: https://kafka-python.readthedocs.io/compatibility.html
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
:target: https://pypi.python.org/pypi/kafka-python
:target: https://kafka-python-ng.readthedocs.io/compatibility.html
.. image:: https://img.shields.io/pypi/pyversions/kafka-python-ng.svg
:target: https://pypi.python.org/pypi/kafka-python-ng

kafka-python is compatible with (and tested against) broker versions 2.6
through 0.8.0 . kafka-python is not compatible with the 0.8.2-beta release.
kafka-python-ng is compatible with (and tested against) broker versions 2.6
through 0.8.0 . kafka-python-ng is not compatible with the 0.8.2-beta release.

Because the kafka server protocol is backwards compatible, kafka-python is
Because the kafka server protocol is backwards compatible, kafka-python-ng is
expected to work with newer broker releases as well.

Although kafka-python is tested and expected to work on recent broker versions,
Although kafka-python-ng is tested and expected to work on recent broker versions,
not all features are supported. Specifically, authentication codecs, and
transactional producer/consumer support are not fully implemented. PRs welcome!

kafka-python is tested on python 2.7, 3.4, 3.7, 3.8 and pypy2.7.
kafka-python-ng is tested on python 2.7, 3.4, 3.7, 3.8 and pypy2.7.

Builds and tests via Travis-CI. See https://travis-ci.org/dpkp/kafka-python
Builds and tests via Travis-CI. See https://travis-ci.org/wbarnha/kafka-python-ng
10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# kafka-python documentation build configuration file, created by
# kafka-python-ng documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 4 12:21:50 2015.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -47,7 +47,7 @@
master_doc = 'index'

# General information about the project.
project = u'kafka-python'
project = u'kafka-python-ng'
copyright = u'2016 -- Dana Powers, David Arthur, and Contributors'

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -201,7 +201,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'kafka-python.tex', u'kafka-python Documentation',
('index', 'kafka-python-ng.tex', u'kafka-python-ng Documentation',
u'Dana Powers', 'manual'),
]

Expand Down Expand Up @@ -231,7 +231,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'kafka-python', u'kafka-python Documentation',
('index', 'kafka-python-ng', u'kafka-python-ng Documentation',
[u'Dana Powers'], 1)
]

Expand All @@ -245,7 +245,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'kafka-python', u'kafka-python Documentation',
('index', 'kafka-python-ng', u'kafka-python-ng Documentation',
u'Dana Powers', 'kafka-python', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
18 changes: 10 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
kafka-python
kafka-python-ng
############

.. image:: https://img.shields.io/badge/kafka-2.6%2C%202.5%2C%202.4%2C%202.3%2C%202.2%2C%202.1%2C%202.0%2C%201.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
:target: https://kafka-python.readthedocs.io/en/master/compatibility.html
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
:target: https://pypi.python.org/pypi/kafka-python
.. image:: https://coveralls.io/repos/dpkp/kafka-python/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/dpkp/kafka-python?branch=master
.. image:: https://travis-ci.org/dpkp/kafka-python.svg?branch=master
:target: https://travis-ci.org/dpkp/kafka-python
:target: https://pypi.python.org/pypi/kafka-python-ng
.. image:: https://coveralls.io/repos/wbarnha/kafka-python-ng/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/wbarnha/kafka-python-ng?branch=master
.. image:: https://travis-ci.org/wbarnha/kafka-python-ng.svg?branch=master
:target: https://travis-ci.org/wbarnha/kafka-python-ng
.. image:: https://img.shields.io/badge/license-Apache%202-blue.svg
:target: https://github.com/dpkp/kafka-python/blob/master/LICENSE
:target: https://github.com/wbarnha/kafka-python-ng/blob/master/LICENSE

Python client for the Apache Kafka distributed stream processing system.
kafka-python is designed to function much like the official java client, with a
Expand All @@ -31,9 +31,11 @@ failures. See `Compatibility <compatibility.html>`_ for more details.
Please note that the master branch may contain unreleased features. For release
documentation, please see readthedocs and/or python's inline help.


.. code:: bash
pip install kafka-python
pip install kafka-python-ng
KafkaConsumer
Expand Down
Loading

0 comments on commit d26351d

Please sign in to comment.