`packaging` is imported at runtime but not declared as a dependency
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 86/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- build-system
Hướng nghiên cứu
Đọc faust/transport/drivers/aiokafka.py quanh dòng 52 để xác nhận Version từ packaging.version là cách sử dụng duy nhất, sau đó thêm một dòng packaging (ví dụ: packaging>=20.0) vào requirements/requirements.txt; chỉ kiểm tra requirements/dist.txt để xem vì sao trước đây nó được cho là đã có. Để xác minh, hãy cài đặt từ requirements đã chỉnh sửa vào một virtualenv mới với aiokafka==0.15.0 và chạy python -c "import faust.transport.drivers.aiokafka". Hoàn tất nghĩa là lần import đó thành công mà packaging không bị một gói khác kéo vào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
faust/transport/drivers/aiokafka.py line 52 does an unconditional from packaging.version import Version. packaging is not listed in requirements/requirements.txt, so it is not in the published Requires-Dist. It only appears in requirements/dist.txt, which is build tooling.
Until now this worked by accident, because aiokafka pulled packaging in. aiokafka 0.15.0 dropped packaging (and async-timeout) from its dependencies. Its requires_dist is now only typing-extensions; python_version<"3.12". A clean install of faust-streaming with aiokafka 0.15.0 therefore has no packaging, and the Kafka transport fails to import.
Versions
- faust-streaming 0.15.4 (latest on PyPI); also checked on master at ca53750
- aiokafka 0.15.0
- Python 3.12
Steps to reproduce
python -m venv /tmp/venv && . /tmp/venv/bin/activate
pip install "faust-streaming==0.15.4" "aiokafka==0.15.0"
pip uninstall -y packaging # only needed if something else in the env pulled it in
python -c "import faust.transport.drivers.aiokafka"
Actual
ModuleNotFoundError: No module named 'packaging'
Expected
The import succeeds, because packaging is installed as a declared dependency of faust-streaming.
Suggested fix
Add packaging to requirements/requirements.txt. It is used only for Version(aiokafka.__version__) comparisons, so a lower bound such as packaging>=20.0 should be enough.
Workaround
Pin packaging explicitly in the application's own requirements.
- Ngôn ngữ chính
- Python
- Star
- 1.9k
- Fork
- 205
- Merge trung bình
- 2 giờ 2 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của faust-streaming/faust
-
scripts/install script forces use of ./venv virtualenv, impossible to use with virtualenvwrapperĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
faust-streaming/faust#28 · 1 bình luận ·
-
[BUG] SASL PLAINTEXT producer initialization fails : missing sasl_plain_username/passwordCó thể đã có người làm @wbarnha đã nhận 56 ngày trước. Đang mở
faust-streaming/faust#794 · 2 bình luận · 1 reaction · 2 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
faust-streaming/faust#670 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
faust-streaming/faust#666 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
faust-streaming/faust#656 ·
Tất cả issue của faust-streaming/faust
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Maintainer] task area:visualizer
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
RailtownAI/railtracks#1824 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
apache/datafusion#27688 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
heasarc/heasarc-tutorials#317 ·
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
mloda-ai/mloda-registry#1664 ·
Maintainer thường phản hồi trong vòng 1 ngày