Skip to content

Commit 2bd7b8a

Browse files
authored
Merge branch 'master' into orange-cpu-usage-while-socket-closed
2 parents 09b5574 + 00750aa commit 2bd7b8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3747
-325
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
# For most projects, this workflow file will not need changing; you simply need
3+
# to commit it to your repository.
4+
#
5+
# You may wish to alter this file to override the set of languages analyzed,
6+
# or to provide custom queries or build logic.
7+
#
8+
# ******** NOTE ********
9+
# We have attempted to detect the languages in your repository. Please check
10+
# the `language` matrix defined below to confirm you have the correct set of
11+
# supported CodeQL languages.
12+
#
13+
name: CodeQL
14+
on:
15+
push:
16+
branches: [master]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [master]
20+
schedule:
21+
- cron: 19 10 * * 6
22+
jobs:
23+
analyze:
24+
name: Analyze
25+
runs-on: ubuntu-latest
26+
permissions:
27+
actions: read
28+
contents: read
29+
security-events: write
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
language: [python]
34+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
35+
# Learn more:
36+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v3
44+
with:
45+
languages: ${{ matrix.language }}
46+
# If you wish to specify custom queries, you can do so here or in a config file.
47+
# By default, queries listed here will override any specified in a config file.
48+
# Prefix the list here with "+" to use these queries and those in the config file.
49+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
50+
51+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
52+
# If this step fails, then you should remove it and run the build manually (see below)
53+
- name: Autobuild
54+
uses: github/codeql-action/autobuild@v3
55+
56+
# ℹ️ Command-line programs to run using the OS shell.
57+
# 📚 https://git.io/JvXDl
58+
59+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
60+
# and modify them (or add more) to build your code if your project
61+
# uses a compiled language
62+
63+
#- run: |
64+
# make bootstrap
65+
# make release
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v3
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
release:
9+
types: [created]
10+
branches:
11+
- 'master'
12+
workflow_dispatch:
13+
14+
env:
15+
FORCE_COLOR: "1" # Make tools pretty.
16+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
17+
PIP_NO_PYTHON_VERSION_WARNING: "1"
18+
PYTHON_LATEST: "3.12"
19+
KAFKA_LATEST: "2.6.0"
20+
21+
# For re-actors/checkout-python-sdist
22+
sdist-artifact: python-package-distributions
23+
24+
jobs:
25+
26+
build-sdist:
27+
name: 📦 Build the source distribution
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout project
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
- name: Set up Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ env.PYTHON_LATEST }}
38+
cache: pip
39+
- run: python -m pip install build
40+
name: Install core libraries for build and install
41+
- name: Build artifacts
42+
run: python -m build
43+
- name: Upload built artifacts for testing
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: ${{ env.sdist-artifact }}
47+
# NOTE: Exact expected file names are specified here
48+
# NOTE: as a safety measure — if anything weird ends
49+
# NOTE: up being in this dir or not all dists will be
50+
# NOTE: produced, this will fail the workflow.
51+
path: dist/${{ env.sdist-name }}
52+
retention-days: 15
53+
54+
test-python:
55+
name: Tests on ${{ matrix.python-version }}
56+
needs:
57+
- build-sdist
58+
runs-on: ubuntu-latest
59+
continue-on-error: ${{ matrix.experimental }}
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
python-version:
64+
- "3.8"
65+
- "3.9"
66+
- "3.10"
67+
- "3.11"
68+
- "3.12"
69+
- "pypy3.9"
70+
experimental: [ false ]
71+
include:
72+
- python-version: "~3.13.0-0"
73+
experimental: true
74+
steps:
75+
- name: Checkout the source code
76+
uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 0
79+
- name: Setup java
80+
uses: actions/setup-java@v4
81+
with:
82+
distribution: temurin
83+
java-version: 11
84+
- name: Set up Python
85+
uses: actions/setup-python@v5
86+
with:
87+
python-version: ${{ matrix.python-version }}
88+
cache: pip
89+
cache-dependency-path: |
90+
requirements-dev.txt
91+
- name: Check Java installation
92+
run: source travis_java_install.sh
93+
- name: Pull Kafka releases
94+
run: ./build_integration.sh
95+
env:
96+
PLATFORM: ${{ matrix.platform }}
97+
KAFKA_VERSION: ${{ env.KAFKA_LATEST }}
98+
# TODO: Cache releases to expedite testing
99+
- name: Install dependencies
100+
run: |
101+
sudo apt install -y libsnappy-dev libzstd-dev
102+
python -m pip install --upgrade pip
103+
python -m pip install tox tox-gh-actions
104+
pip install .
105+
pip install -r requirements-dev.txt
106+
- name: Test with tox
107+
run: tox
108+
env:
109+
PLATFORM: ${{ matrix.platform }}
110+
KAFKA_VERSION: ${{ env.KAFKA_LATEST }}
111+
112+
test-kafka:
113+
name: Tests for Kafka ${{ matrix.kafka-version }} (Python ${{ matrix.python-version }})
114+
needs:
115+
- build-sdist
116+
runs-on: ubuntu-latest
117+
timeout-minutes: 10
118+
strategy:
119+
fail-fast: false
120+
matrix:
121+
kafka-version:
122+
- "0.9.0.1"
123+
- "0.10.2.2"
124+
- "0.11.0.2"
125+
- "0.11.0.3"
126+
- "1.1.1"
127+
- "2.4.0"
128+
- "2.5.0"
129+
- "2.6.0"
130+
python-version: ['3.12']
131+
experimental: [false]
132+
include:
133+
- kafka-version: '0.8.2.2'
134+
experimental: true
135+
python-version: "3.12"
136+
- kafka-version: '0.8.2.2'
137+
experimental: false
138+
python-version: "3.10"
139+
env:
140+
PYTHON_LATEST: ${{ matrix.python-version }}
141+
continue-on-error: ${{ matrix.experimental }}
142+
steps:
143+
- name: Checkout the source code
144+
uses: actions/checkout@v4
145+
with:
146+
fetch-depth: 0
147+
- name: Setup java
148+
uses: actions/setup-java@v4
149+
with:
150+
distribution: temurin
151+
java-version: 8
152+
- name: Set up Python
153+
uses: actions/setup-python@v5
154+
with:
155+
python-version: ${{ matrix.python-version }}
156+
cache: pip
157+
cache-dependency-path: |
158+
requirements-dev.txt
159+
- name: Pull Kafka releases
160+
run: ./build_integration.sh
161+
env:
162+
# This is fast enough as long as you pull only one release at a time,
163+
# no need to worry about caching
164+
PLATFORM: ${{ matrix.platform }}
165+
KAFKA_VERSION: ${{ matrix.kafka-version }}
166+
- name: Install dependencies
167+
run: |
168+
sudo apt install -y libsnappy-dev libzstd-dev
169+
python -m pip install --upgrade pip
170+
python -m pip install tox tox-gh-actions
171+
pip install .
172+
pip install -r requirements-dev.txt
173+
- name: Test with tox
174+
run: tox
175+
env:
176+
PLATFORM: ${{ matrix.platform }}
177+
KAFKA_VERSION: ${{ matrix.kafka-version }}
178+
179+
check: # This job does nothing and is only used for the branch protection
180+
name: ✅ Ensure the required checks passing
181+
if: always()
182+
needs:
183+
- build-sdist
184+
- test-python
185+
- test-kafka
186+
runs-on: ubuntu-latest
187+
steps:
188+
- name: Decide whether the needed jobs succeeded or failed
189+
uses: re-actors/alls-green@release/v1
190+
with:
191+
jobs: ${{ toJSON(needs) }}
192+
publish:
193+
name: 📦 Publish to PyPI
194+
runs-on: ubuntu-latest
195+
needs: [build-sdist]
196+
permissions:
197+
id-token: write
198+
environment: pypi
199+
if: github.event_name == 'release' && github.event.action == 'created'
200+
steps:
201+
- name: Download the artifacts
202+
uses: actions/download-artifact@v4
203+
with:
204+
name: ${{ env.sdist-artifact }}
205+
path: dist/${{ env.sdist-name }}
206+
- name: Publish package to PyPI
207+
uses: pypa/gh-action-pypi-publish@release/v1
208+
with:
209+
password: ${{ secrets.PYPI_API_TOKEN }}

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ env:
1717
- KAFKA_VERSION=1.1.1
1818
- KAFKA_VERSION=2.4.0
1919
- KAFKA_VERSION=2.5.0
20+
- KAFKA_VERSION=2.6.0
2021

2122
addons:
2223
apt:
2324
packages:
2425
- libsnappy-dev
26+
- libzstd-dev
2527
- openjdk-8-jdk
2628

2729
cache:

CHANGES.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
# 2.0.2 (Sep 29, 2020)
2+
3+
Consumer
4+
* KIP-54: Implement sticky partition assignment strategy (aynroot / PR #2057)
5+
* Fix consumer deadlock when heartbeat thread request timeout (huangcuiyang / PR #2064)
6+
7+
Compatibility
8+
* Python 3.8 support (Photonios / PR #2088)
9+
10+
Cleanups
11+
* Bump dev requirements (jeffwidman / PR #2129)
12+
* Fix crc32c deprecation warning (crc32c==2.1) (jeffwidman / PR #2128)
13+
* Lint cleanup (jeffwidman / PR #2126)
14+
* Fix initialization order in KafkaClient (pecalleja / PR #2119)
15+
* Allow installing crc32c via extras (mishas / PR #2069)
16+
* Remove unused imports (jameslamb / PR #2046)
17+
18+
Admin Client
19+
* Merge _find_coordinator_id methods (jeffwidman / PR #2127)
20+
* Feature: delete consumergroups (swenzel / PR #2040)
21+
* Allow configurable timeouts in admin client check version (sunnyakaxd / PR #2107)
22+
* Enhancement for Kafka Admin Client's "Describe Consumer Group" (Apurva007 / PR #2035)
23+
24+
Protocol
25+
* Add support for zstd compression (gabriel-tincu / PR #2021)
26+
* Add protocol support for brokers 1.1.0 - 2.5.0 (gabriel-tincu / PR #2038)
27+
* Add ProduceRequest/ProduceResponse v6/v7/v8 (gabriel-tincu / PR #2020)
28+
* Fix parsing NULL header values (kvfi / PR #2024)
29+
30+
Tests
31+
* Add 2.5.0 to automated CI tests (gabriel-tincu / PR #2038)
32+
* Add 2.1.1 to build_integration (gabriel-tincu / PR #2019)
33+
34+
Documentation / Logging / Errors
35+
* Disable logging during producer object gc (gioele / PR #2043)
36+
* Update example.py; use threading instead of multiprocessing (Mostafa-Elmenbawy / PR #2081)
37+
* Fix typo in exception message (haracejacob / PR #2096)
38+
* Add kafka.structs docstrings (Mostafa-Elmenbawy / PR #2080)
39+
* Fix broken compatibility page link (anuragrana / PR #2045)
40+
* Rename README to README.md (qhzxc0015 / PR #2055)
41+
* Fix docs by adding SASL mention (jeffwidman / #1990)
42+
143
# 2.0.1 (Feb 19, 2020)
244

345
Admin Client
@@ -371,7 +413,7 @@ Some of the major changes include:
371413
* SASL authentication is working (we think)
372414
* Removed several circular references to improve gc on close()
373415

374-
Thanks to all contributors -- the state of the kafka-python community is strong!
416+
Thanks to all contributors -- the state of the kafka-python-ng community is strong!
375417

376418
Detailed changelog are listed below:
377419

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ test37: build-integration
2020
test27: build-integration
2121
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py27 -- $(FLAGS)
2222

23-
# Test using py.test directly if you want to use local python. Useful for other
23+
# Test using pytest directly if you want to use local python. Useful for other
2424
# platforms that require manual installation for C libraries, ie. Windows.
2525
test-local: build-integration
26-
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) py.test \
26+
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) pytest \
2727
--pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF $(FLAGS) kafka test
2828

2929
cov-local: build-integration
30-
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) py.test \
30+
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) pytest \
3131
--pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF --cov=kafka \
3232
--cov-config=.covrc --cov-report html $(FLAGS) kafka test
3333
@echo "open file://`pwd`/htmlcov/index.html"
3434

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

0 commit comments

Comments
 (0)