Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include README.md
include LICENSE
include src/confluent_kafka/src/*.[ch]
include src/confluent_kafka/py.typed
include src/confluent_kafka/cimpl.pyi
prune tests
prune docs
prune docs
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ all:
@echo "Targets:"
@echo " clean"
@echo " docs"
@echo " mypy"
@echo " style-check"
@echo " style-fix"


clean:
Expand All @@ -14,6 +17,9 @@ clean:
docs:
$(MAKE) -C docs html

mypy:
python3 -m mypy src/confluent_kafka

style-check:
@(tools/style-format.sh \
$$(git ls-tree -r --name-only HEAD | egrep '\.(c|h|py)$$') )
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ urllib3<3
flake8
mypy
types-cachetools
types-requests
orjson
pytest
pytest-timeout
Expand Down
4 changes: 4 additions & 0 deletions tools/source-package-verification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ if [[ $OS_NAME == linux && $ARCH == x64 ]]; then
# Run these actions and tests only in this case
echo "Building documentation ..."
flake8 --exclude ./_venv,*_pb2.py,./build

echo "Running mypy type checking ..."
mypy src/confluent_kafka
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mypy invocation should match the configuration used in tox.ini. Consider using tox -e mypy instead of calling mypy directly to ensure consistency between local development and CI environments.

Suggested change
mypy src/confluent_kafka
tox -e mypy

Copilot uses AI. Check for mistakes.

pip install -r requirements/requirements-docs.txt
make docs

Expand Down
9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = flake8,py37,py38,py39,py310,py311,py312,py313
envlist = flake8,mypy,py37,py38,py39,py310,py311,py312,py313

[testenv]
passenv =
Expand All @@ -20,6 +20,13 @@ commands =
deps = flake8
commands = flake8

[testenv:mypy]
deps =
mypy
types-cachetools
types-requests
commands = mypy src/confluent_kafka
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mypy command should include the --strict or explicit configuration flags (e.g., --disallow-untyped-defs, --warn-return-any) to ensure consistent type checking behavior. Without explicit flags, mypy's behavior depends on project configuration files which may not be present, leading to inconsistent results across environments.

Suggested change
commands = mypy src/confluent_kafka
commands = mypy --strict src/confluent_kafka

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have config in pyproject.toml


[pytest]
python_files = test_*
testpaths = tests
Expand Down