Skip to content

Commit 7f262e0

Browse files
authored
Merge branch 'master' into feature/SASL-Extensions
2 parents 03c357f + c02df08 commit 7f262e0

40 files changed

+634
-149
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: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
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+
steps:
72+
- name: Checkout the source code
73+
uses: actions/checkout@v4
74+
with:
75+
fetch-depth: 0
76+
- name: Setup java
77+
uses: actions/setup-java@v4
78+
with:
79+
distribution: temurin
80+
java-version: 11
81+
- name: Set up Python
82+
uses: actions/setup-python@v5
83+
with:
84+
python-version: ${{ matrix.python-version }}
85+
cache: pip
86+
cache-dependency-path: |
87+
requirements-dev.txt
88+
- name: Check Java installation
89+
run: source travis_java_install.sh
90+
- name: Pull Kafka releases
91+
run: ./build_integration.sh
92+
env:
93+
PLATFORM: ${{ matrix.platform }}
94+
KAFKA_VERSION: ${{ env.KAFKA_LATEST }}
95+
# TODO: Cache releases to expedite testing
96+
- name: Install dependencies
97+
run: |
98+
sudo apt install -y libsnappy-dev libzstd-dev
99+
python -m pip install --upgrade pip
100+
python -m pip install tox tox-gh-actions
101+
pip install .
102+
pip install -r requirements-dev.txt
103+
- name: Test with tox
104+
run: tox
105+
env:
106+
PLATFORM: ${{ matrix.platform }}
107+
KAFKA_VERSION: ${{ env.KAFKA_LATEST }}
108+
109+
test-kafka:
110+
name: Tests for Kafka ${{ matrix.kafka-version }} (Python ${{ matrix.python-version }})
111+
needs:
112+
- build-sdist
113+
runs-on: ubuntu-latest
114+
timeout-minutes: 10
115+
strategy:
116+
fail-fast: false
117+
matrix:
118+
kafka-version:
119+
- "0.9.0.1"
120+
- "0.10.2.2"
121+
- "0.11.0.2"
122+
- "0.11.0.3"
123+
- "1.1.1"
124+
- "2.4.0"
125+
- "2.5.0"
126+
- "2.6.0"
127+
python-version: ['3.12']
128+
experimental: [false]
129+
include:
130+
- kafka-version: '0.8.2.2'
131+
experimental: true
132+
python-version: "3.12"
133+
- kafka-version: '0.8.2.2'
134+
experimental: false
135+
python-version: "3.10"
136+
env:
137+
PYTHON_LATEST: ${{ matrix.python-version }}
138+
continue-on-error: ${{ matrix.experimental }}
139+
steps:
140+
- name: Checkout the source code
141+
uses: actions/checkout@v4
142+
with:
143+
fetch-depth: 0
144+
- name: Setup java
145+
uses: actions/setup-java@v4
146+
with:
147+
distribution: temurin
148+
java-version: 8
149+
- name: Set up Python
150+
uses: actions/setup-python@v5
151+
with:
152+
python-version: ${{ matrix.python-version }}
153+
cache: pip
154+
cache-dependency-path: |
155+
requirements-dev.txt
156+
- name: Pull Kafka releases
157+
run: ./build_integration.sh
158+
env:
159+
# This is fast enough as long as you pull only one release at a time,
160+
# no need to worry about caching
161+
PLATFORM: ${{ matrix.platform }}
162+
KAFKA_VERSION: ${{ matrix.kafka-version }}
163+
- name: Install dependencies
164+
run: |
165+
sudo apt install -y libsnappy-dev libzstd-dev
166+
python -m pip install --upgrade pip
167+
python -m pip install tox tox-gh-actions
168+
pip install .
169+
pip install -r requirements-dev.txt
170+
- name: Test with tox
171+
run: tox
172+
env:
173+
PLATFORM: ${{ matrix.platform }}
174+
KAFKA_VERSION: ${{ matrix.kafka-version }}
175+
176+
check: # This job does nothing and is only used for the branch protection
177+
name: ✅ Ensure the required checks passing
178+
if: always()
179+
needs:
180+
- build-sdist
181+
- test-python
182+
- test-kafka
183+
runs-on: ubuntu-latest
184+
steps:
185+
- name: Decide whether the needed jobs succeeded or failed
186+
uses: re-actors/alls-green@release/v1
187+
with:
188+
jobs: ${{ toJSON(needs) }}
189+
publish:
190+
name: 📦 Publish to PyPI
191+
runs-on: ubuntu-latest
192+
needs: [build-sdist]
193+
permissions:
194+
id-token: write
195+
environment: pypi
196+
if: github.event_name == 'release' && github.event.action == 'created'
197+
steps:
198+
- name: Download the artifacts
199+
uses: actions/download-artifact@v4
200+
with:
201+
name: ${{ env.sdist-artifact }}
202+
path: dist/${{ env.sdist-name }}
203+
- name: Publish package to PyPI
204+
uses: pypa/gh-action-pypi-publish@release/v1
205+
with:
206+
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)