-
Notifications
You must be signed in to change notification settings - Fork 9
Support python 3.12 #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- bump virtualenv to have a new enough pip in virtualenv - upgrade xxhash to support python 3.12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Python 3.12 by removing the kafka.vendor.six
compatibility layer that was causing import errors, since Python 2 support is no longer needed. The PR modernizes the codebase to use Python 3's standard library directly.
- Removes all
kafka.vendor.six
imports and replaces them with Python 3 standard library equivalents - Updates CI/testing configuration to support Python 3.10-3.12 and drops older Python versions
- Fixes a broken test assertion and unconditionally skips a failing test
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tox.ini | Updates Python version matrix to 3.10-3.12 and removes Yelp-specific configuration |
test/test_producer_legacy.py | Replaces kafka.vendor.six.moves.queue with standard queue import |
test/test_producer_integration.py | Removes unused kafka.vendor.six.moves.range import |
test/test_consumer_integration.py | Removes unused range import and unconditionally skips failing test |
test/test_codec.py | Removes unused range import |
test/test_client_async.py | Fixes broken test assertions and adds missing mock import |
test/fixtures.py | Replaces six urllib imports with standard library equivalents |
setup.py | Sets minimum Python version requirement to 3.10 |
requirements-dev.txt | Updates package versions for Python 3.10-3.12 compatibility |
kafka/version.py | Bumps version number |
kafka/producer/simple.py | Removes unused range import |
kafka/msk.py | Replaces six urllib import with standard library |
kafka/consumer/simple.py | Replaces six imports with standard library equivalents |
kafka/consumer/multiprocess.py | Replaces six queue import with standard library |
kafka/codec.py | Removes six compatibility code and unused imports |
Makefile | Simplifies test command to use tox.ini configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The main issue here is that for somewhat unclear reasons
kafka.vendor.six
results in an import error under python 3.12. Since none of that is necessary in python 3--which in a practical sense is all we support--I just removed it, unblocking python 3.12.As a matter of course I did a few other things:
make test
now relies on the tox.ini envlist instead of hardcoding a different list