Skip to content

Commit 7e65560

Browse files
authored
Merge branch 'master' into feature/skip_control_batch
2 parents e2e85eb + 38e159a commit 7e65560

37 files changed

+621
-138
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"

.github/workflows/codeql-analysis.yml

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

.github/workflows/python-package.yml

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
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 }}
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+
experimental: [false]
131+
include:
132+
- kafka-version: '0.8.2.2'
133+
experimental: true
134+
continue-on-error: ${{ matrix.experimental }}
135+
steps:
136+
- name: Checkout the source code
137+
uses: actions/checkout@v4
138+
with:
139+
fetch-depth: 0
140+
- name: Setup java
141+
uses: actions/setup-java@v4
142+
with:
143+
distribution: temurin
144+
java-version: 8
145+
- name: Set up Python
146+
uses: actions/setup-python@v5
147+
with:
148+
python-version: ${{ env.PYTHON_LATEST }}
149+
cache: pip
150+
cache-dependency-path: |
151+
requirements-dev.txt
152+
- name: Pull Kafka releases
153+
run: ./build_integration.sh
154+
env:
155+
# This is fast enough as long as you pull only one release at a time,
156+
# no need to worry about caching
157+
PLATFORM: ${{ matrix.platform }}
158+
KAFKA_VERSION: ${{ matrix.kafka-version }}
159+
- name: Install dependencies
160+
run: |
161+
sudo apt install -y libsnappy-dev libzstd-dev
162+
python -m pip install --upgrade pip
163+
python -m pip install tox tox-gh-actions
164+
pip install .
165+
pip install -r requirements-dev.txt
166+
- name: Test with tox
167+
run: tox
168+
env:
169+
PLATFORM: ${{ matrix.platform }}
170+
KAFKA_VERSION: ${{ matrix.kafka-version }}
171+
172+
check: # This job does nothing and is only used for the branch protection
173+
name: ✅ Ensure the required checks passing
174+
if: always()
175+
needs:
176+
- build-sdist
177+
- test-python
178+
- test-kafka
179+
runs-on: ubuntu-latest
180+
steps:
181+
- name: Decide whether the needed jobs succeeded or failed
182+
uses: re-actors/alls-green@release/v1
183+
with:
184+
jobs: ${{ toJSON(needs) }}
185+
publish:
186+
name: 📦 Publish to PyPI
187+
runs-on: ubuntu-latest
188+
needs: [build-sdist]
189+
permissions:
190+
id-token: write
191+
environment: pypi
192+
if: github.event_name == 'release' && github.event.action == 'created'
193+
steps:
194+
- name: Download the artifacts
195+
uses: actions/download-artifact@v4
196+
with:
197+
name: ${{ env.sdist-artifact }}
198+
path: dist/${{ env.sdist-name }}
199+
- name: Publish package to PyPI
200+
uses: pypa/gh-action-pypi-publish@release/v1
201+
with:
202+
password: ${{ secrets.PYPI_API_TOKEN }}

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ Some of the major changes include:
413413
* SASL authentication is working (we think)
414414
* Removed several circular references to improve gc on close()
415415

416-
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!
417417

418418
Detailed changelog are listed below:
419419

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)