Skip to content

Declare packaging as a runtime dependency - #805

Merged
wbarnha merged 1 commit into
faust-streaming:masterfrom
Gxuravkumar911:declare-packaging-dependency
Nov 28, 2026
Merged

wbarnha merged 1 commit into
faust-streaming:masterfrom
Gxuravkumar911:declare-packaging-dependency

Conversation

@Gxuravkumar911

Copy link
Copy Markdown
Contributor

Description

Fixes #804.

faust/transport/drivers/aiokafka.py does from packaging.version import Version at import time, but packaging is only listed in requirements/dist.txt, so it isn't in the published dependencies. It worked because aiokafka used to pull it in. aiokafka 0.15.0 dropped that dependency, so a clean pip install faust-streaming aiokafka==0.15.0 can't import the Kafka transport:

ModuleNotFoundError: No module named 'packaging'

This adds packaging>=20.0 to requirements/requirements.txt (it's only used for Version(...) comparisons, so any reasonably recent release works).

Checked in a fresh venv: installing from master with aiokafka==0.15.0 and no packaging reproduces the error above; with this change pip install . brings in packaging and import faust.transport.drivers.aiokafka succeeds.

faust/transport/drivers/aiokafka.py imports packaging.version at module
level, but packaging was only listed in requirements/dist.txt. It was
installed anyway because aiokafka depended on it, until aiokafka 0.15.0
dropped it. A clean install with aiokafka 0.15.0 now fails to import the
Kafka transport with ModuleNotFoundError.

Fixes faust-streaming#804
@wbarnha

wbarnha commented Nov 28, 2026

Copy link
Copy Markdown
Member

Thank you for the PR! I'll get this merged and shipped ASAP

@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.19%. Comparing base (ca53750) to head (348bd4b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #805   +/-   ##
=======================================
  Coverage   96.19%   96.19%           
=======================================
  Files         110      110           
  Lines       11789    11789           
  Branches     1282     1282           
=======================================
  Hits        11341    11341           
  Misses        351      351           
  Partials       97       97           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wbarnha
wbarnha merged commit aff63f2 into faust-streaming:master Nov 28, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

packaging is imported at runtime but not declared as a dependency

2 participants